So I want to have an arg, but also a way to overwrite this arg via onbuild. Something like this in the base dockerfile:
ONBUILD ARG randvar
In my child dockerfile I have
RUN echo $randvar
But I can’t seem to overwrite the ARG for some reason.
This is my docker-compose file.
randvar: "this is orig arg"
randvar: "this is new arg"
First I run docker-compose run basec then docker-compose run childc
My echo statement is showing "this is orig arg" instead of "this is new arg"
docker-compose run basec
docker-compose run childc
Source: Docker Questions
Our dedicated development team is here for you!
We can help you find answers to your question for as low as 5$.