2 Solutions collect form web for “Docker build argument”

We’ve had a similar requirement and came up with a relatively simple script that does exactly that:

We create a file called dockerfile_template in which we use variables just like you describe. The script takes that file, performs string substitutions and copies it to dockerfile (no _template) before calling docker build dockerfile.