How to set Docker ENTRYPOINT To NPM?
<p>I have a Node.js project that is using npm scripts. An excerpt from <code>package.json</code> :</p>

<pre><code>  "scripts": {
    "test": "echo \"Error: no test specified\" &amp;&amp; exit 1",
    "build-all": "./node_modules/.bin/webpack --progress --config ./webpack/client.config.js &amp;&amp; ./node_modules/.bin/webpack --progress --config ./webpack/server.config.js",
    "web": "python -m SimpleHTTPServer 8888",
    "server" : "./node_modules/.bin/electron-spawn ./dist/server.js"
  },
</code></pre>

<p>I'm creating a <code>Dockerfile</code> for this project. I was hoping to use npm as the ENTRYPOINT for the image. In the Dockerfile I have:</p>

<p><code>ENTRYPOINT ['/usr/local/bin/npm' 'run']</code></p>

<p>when I try to start a hcontainer form the image it says it cannot find npm</p>

<pre><code>root@vagrant-ubuntu-trusty-64:/home/vagrant# docker run my_image web
web: 1: web: [/usr/local/bin/npm: not found
</code></pre>

<p>if I start a shell in the image it looks like the npm executable is at that path</p>

<pre><code>root@vagrant-ubuntu-trusty-64:/home/vagrant# docker run -i -t --entrypoint /bin/bash my_image
root@5e7362a64412:/# ls /usr/local/bin/npm
/usr/local/bin/npm
</code></pre>