docker ARG and ENV

  1. ARG is only available during build
  2. ENV is available can be available during build as well as after the build
FROM httpd
ARG arg1
ENV env1=evalue1
ENV env2=${arg1}
ENV env3=evalue3
docker build --build-arg arg1=atest -t httpd-test .
docker run -d --env-file=env_file  httpd-test

Published by

Leave a Reply

Your email address will not be published. Required fields are marked *