I would like to be able to pass Args from docker-compose file > dockerfile and later to CMD/ENTRYPOINT that runs a python script which accepts parameters
ARG INSTANCE_NUM
ENV INSTANCE_NUM=$INSTANCE_NUM
RUN echo $INSTANCE_NUM
ARG TOTAL_INSTANCES
ENV TOTAL_INSTANCES=$TOTAL_INSTANCES
RUN echo $TOTAL_INSTANCES
CMD ["python", "test.py", "$INSTANCE_NUM",
"$TOTAL_INSTANCES"]
While running build, RUN echo $INSTANCE_NUM and RUN echo $TOTAL_INSTANCES prints the actual value that is set in the docker-compose file but
the current result is that the python script accepts the ARGS as is, without accepting the value given in docker-compose file. e.g If printed out its str $INSTANCE_NUM or str $TOTAL_INSTANCES I would like to be able to get the actual value I've set in the docker-compose file for the ARG which is passed.
Please assist, maybe i'm missing here something or just did not understand properly.
Thanks!