title: Can docker entrypoint in shell form use runtime command args?
body: <p>Here is a sample dockerfile with a shell-form entrypoint:</p>
  <pre><code>FROM ubuntu
  ENTRYPOINT /bin/echo &quot;(shell) ENTRYPOINT@image ($0)&quot;
  </code></pre>
  <p>Below, are some of the outputs that I see from various runs:</p>
  <pre><code>$ docker run -it sc-test:v4
  (shell) ENTRYPOINT@image (/bin/sh)
  $ docker run -it sc-test:v4 /bin/echo
  (shell) ENTRYPOINT@image (/bin/echo)
  $ docker run -it sc-test:v4 /bin/cat
  (shell) ENTRYPOINT@image (/bin/cat)
  $ docker run -it sc-test:v4 /bin/dog
  (shell) ENTRYPOINT@image (/bin/dog)
  $ docker run -it sc-test:v4 &quot;/bin/dog ($0)&quot;
  (shell) ENTRYPOINT@image (/bin/dog (-bash))
  </code></pre>
  <p>Based on docker documentation <a href="https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact" rel="nofollow noreferrer">here</a>, we can see that the command args are ignored.</p>
  <p>However, the value of <code>$0</code> changes with the args provided. Can someone explain why this happens? Thanks!</p>