title: Docker CMD when base image has a CMD?
body: <p>I have a Dockerfile which starts with:</p>
  
  <pre><code>FROM puppet/puppetserver
  </code></pre>
  
  <p>When I look at the <a href="https://github.com/puppetlabs/puppet-in-docker/blob/master/puppetserver/Dockerfile" rel="nofollow noreferrer">source container</a> it is built from <a href="https://github.com/puppetlabs/puppet-in-docker/blob/master/puppetserver-standalone/Dockerfile" rel="nofollow noreferrer">another</a>:</p>
  
  <pre><code>FROM puppet/puppetserver-standalone:5.0.0
  </code></pre>
  
  <p>The second contains a <code>CMD</code> command:</p>
  
  <pre><code>ENTRYPOINT ["dumb-init", "/docker-entrypoint.sh"]
  CMD ["foreground" ]
  </code></pre>
  
  <p>In my own container I end with:</p>
  
  <pre><code>COPY start.sh /
  CMD /start.sh
  </code></pre>
  
  <p>The <code>CMD</code> run but with unexpected results:</p>
  
  <blockquote>
    <p>puppetserver: '/bin/sh' is not a puppetserver command. See 'puppetserver --help'.</p>
  </blockquote>
  
  <p>I know that I have bash availible because I'm using <code>RUN commands.sh</code> before <code>CMD</code> in the same Dockerfile.</p>
  
  <p>How do <code>CMD</code> commands stack when inheriting from base images?</p>
  
  <p>Is my <code>CMD</code> not run as a normal bash command and instead run in conjunction with the <code>CMD</code> of the base image?</p>