title: Is Docker ARG allowed within CMD instruction
body: <p>I have a Dockerfile where an <code>ARG</code> is used in the <code>CMD</code> instruction:</p>
  
  <pre><code>ARG MASTER_NAME
  CMD spark-submit --deploy-mode client --master ${MASTER_URL}
  </code></pre>
  
  <p>The arg is passed via docker-compose:</p>
  
  <pre><code>  spark:
      build:
        context: spark
        args:
          - MASTER_URL=spark://master:7077
  </code></pre>
  
  <p>However, the <code>ARG</code> does not seem to get expanded for <code>CMD</code>. After I <code>docker-compose up</code>.</p>
  
  <p>Here's what inspect shows:</p>
  
  <pre><code>docker inspect  -f "{{.Name}} {{.Config.Cmd}}" $(docker ps -a -q)
  /spark {[/bin/sh -c spark-submit --deploy-mode client --master ${MASTER_URL}]}
  </code></pre>