title: Pass argument to dockerfile @ runtime
body: <p>Basically want to be able to run a docker container with specified arguments</p>
  
  <p>dockerfile:</p>
  
  <pre><code>FROM nodesource/node:4.0
  
  ADD package.json package.json
  RUN npm install
  ADD . .
  
  ENTRYPOINT ["node","index.js"]
  </code></pre>
  
  <p>I am essentially running the tutorial code found for rabbitMQ:
  <a href="https://www.rabbitmq.com/tutorials/tutorial-one-javascript.html" rel="nofollow">https://www.rabbitmq.com/tutorials/tutorial-one-javascript.html</a></p>
  
  <p>The only difference is, for me, instead of a hard coded Que name, i am using $args for it</p>
  
  <pre><code>var argv = require('minimist')(process.argv.slice(2));
  var q = argv.que;
  </code></pre>
  
  <p>the cmd line way i run my nodejs is:
  <code>node index.js --que 1</code></p>
  
  <p>and its working fine. however when executing from the <code>docker run</code> it doesn't seem to be working (args not read correctly)</p>
  
  <p>i have tried:</p>
  
  <p><code>docker run -it mydockerimage --que (my queue name)</code></p>
  
  <p>but getting error:</p>
  
  <blockquote>
    <p>Error response from daemon: oci runtime error: exec: "--que":
    executable file not found in $PATH.</p>
  </blockquote>
  
  <p>What is the correct way for me to write this docker image so that i can pass in arguments at runtime?</p>
  
  <p>I know i can do it by overriding the --entrypoint, but ideally i would like to type less...is this even possible?</p>