title: Environment variable in the Docker file for a specific RUN command
body: <p>In my Dockerfile, I have:</p>
  
  <pre><code>ENV ENVIRONMENT=$ENVIRONMENT
  CMD NODE_ENV=$ENVIRONMENT npm run serve
  </code></pre>
  
  <p>However, I need to run another command BEFORE serve, and make sure NODE_ENV Is set for that one too.
  I tried this:</p>
  
  <pre><code>ENV ENVIRONMENT=$ENVIRONMENT
  RUN NODE_ENV=$ENVIRONMENT npm run upgrade
  CMD NODE_ENV=$ENVIRONMENT npm run serve
  </code></pre>
  
  <p>However, NODE_ENV doesn't seem to be set for RUN.</p>
  
  <p>What am I missing?</p>
  
  <p>(Note: edited tag removed)</p>