title: Dockerfile CMD does not interpolate ENV
body: <p>I have tried every combination I can think of.</p>
  <p><strong>docker-compose.yml</strong></p>
  <pre class="lang-yaml prettyprint-override"><code>version: &quot;3.1&quot;
  services:
    node-server:
      build: 
        context: .
        dockerfile: Dockerfile
        args:
          - MYVAR=${MYVAR}
      environment:
        - ENV_MYVAR=${MYVAR}
      ports:
        - 8000:8000
      env_file:
        - .env
      # command: [&quot;npm&quot;, &quot;run&quot;, &quot;_${MYVAR}_&quot;] This works, but for the sake of testing CMD in Dockerfile, I can't get that to work
  
  </code></pre>
  <p><strong>Dockerfile</strong></p>
  <pre><code>FROM node:14
  ARG MYVAR
  
  ENV ENV_MYVAR=&quot;${MYVAR}&quot;
  
  WORKDIR /usr/src/app
  COPY package*.json ./
  RUN npm i
  COPY . .
  EXPOSE ${port}
  
  RUN echo &quot;1&quot;
  RUN echo $MYVAR # Works
  
  CMD [ &quot;npm&quot;, &quot;run&quot;, &quot;_${ENV_MYVAR}_&quot;] # OUTPUTS as _${ENV_MYVAR}_&quot;. Does not interpolate!!
  
  </code></pre>
  <p><strong>.env</strong></p>
  <pre><code>MYVAR=boot
  </code></pre>
  <p><strong>package.json</strong></p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;name&quot;: &quot;node-server-ts&quot;,
    &quot;version&quot;: &quot;1.0.0&quot;,
    &quot;license&quot;: &quot;MIT&quot;,
    &quot;scripts&quot;: {
      &quot;test&quot;: &quot;echo 'test'&quot;,
      &quot;boot&quot;:  &quot;echo 'boot'&quot;,
      &quot;_boot_&quot;:  &quot;echo '_boot_'&quot;
    }
  }
  </code></pre>
  <p><strong>terminal</strong></p>
  <pre><code>docker-compose up
  </code></pre>
  <p>Expect:</p>
  <pre><code>npm run _boot_
  </code></pre>
  <blockquote>
  <p>error - node-server_1  | <em>${ENV_MYVAR}</em></p>
  </blockquote>