I am wondering if a env variable can be used in a docker from? Reason for this is to control the tagging. For example, say I have this line in my Dockerfile:
From myApp
What I want is this:
From myApp:${VERSION}
This way I can say docker build . myApp --build-arg VERSION=9
The process to build docker images for this app is the same. I don't want to have Dockerfiles that are almost identical just to use a different base image.If I want to build version 9, it should use version 9 of the base image.
question from:
https://stackoverflow.com/questions/36556766/can-a-variable-be-used-in-docker-from 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…