title: Using ARG and ENV in Dockerfile
body: <p>I am learning how to use ARG and ENV in Dockerfiles.
  I have this simple Dockerfile:</p>
  
  <pre><code>ARG my_arg
  ARG other_arg=other_default
  
  FROM centos:7
  
  ENV MY_ENV $my_arg
  ENV OTHER_ENV $other_arg
  
  CMD echo "$MY_ENV $OTHER_ENV"
  </code></pre>
  
  <p>When I build it:
  <code>docker build --build-arg my_arg=my_value</code></p>
  
  <p>And run it:
  <code>docker run &lt;resulting-image&gt;</code></p>
  
  <p>I do not see the expected output, which would be </p>
  
  <pre><code>my_value other_default
  </code></pre>
  
  <p>Instead, I see the empty string.
  What am I doing wrong?</p>