Actually I'm not sure this can be done but I know there is always a hack , so I am enthusiastic about what you experts will say about this.
l want to pass a package as an argument when building my docker image so that I can deploy separate app versions with the same dockerfile.
This is an example for what I want to achieve :
The ability to pass package as an argument when building the image ( I know the syntax is wrong , it's just an example )
docker build -t myapp/myapp:v1 . package_myapp_v1.tar
Then use ADD
in the Dockerfile
to extract it into the container.
ADD passed_package ./
So that if I want to build an image for my app's v2 I can just specify the new package in docker build
command without changing the Dockerfile
.
Anyone knows what's the trick to get that working?
Thanks :)