title: Docker container with entrypoint variable expansion and CMD parameters
body: <p>I want to create a Docker Image that acts as an executable for which the user passes a token as an environment variable. The executable has sub commands that the user should pass via dockers CMD (think of git with authentication via Env).
  However, Docker does not append the CMD to the entrypoint.
  The relevant part of my Dockerfile looks like this:</p>
  
  <pre><code>ENTRYPOINT ["/bin/sh", "-c", "/usr/bin/mycmd --token=$MY_TOKEN"]
  CMD ["pull", "stuff"]
  </code></pre>
  
  <p>So if this container is executed without any CMD overrides and <code>secret</code> as the MY_TOKEN variable, I would expect </p>
  
  <pre><code>mycmd --token=secret pull stuff
  </code></pre>
  
  <p>to be executed. If the user starts the container with an override, e.g.</p>
  
  <pre><code>docker run -it -e MY_TOKEN=secret myimage push junk
  </code></pre>
  
  <p>I would expect</p>
  
  <pre><code>mycmd --token=secret push junk
  </code></pre>
  
  <p>to be executed. As mentioned above, however, only <code>mycmd --token=secret</code> gets executed, the CMD is ignored - no matter if I override it during start or set it in the Dockerfile.</p>