title: npm install doesn't work in Docker
body: <p>This is my Dockerfile:</p>
  
  <pre><code>FROM node:7
  
  RUN apt-get update &amp;&amp; apt-get install -y --no-install-recommends \
      rubygems build-essential ruby-dev \
      &amp;&amp; rm -rf /var/lib/apt/lists/*
  
  RUN npm install -gq gulp bower
  
  RUN mkdir -p /usr/src/app
  WORKDIR /usr/src/app
  COPY . /usr/src/app
  
  RUN npm install
  
  CMD ["gulp", "start:dev"]
  </code></pre>
  
  <p>When I build the image, the npm install command executes with little output and really quickly. I actually build it through docker-compose which does have a volume mounted - and I cannot see the node_modules folder being created on my hose. When I launch a container on this image, I can see there is no node_modules folder. I then execute npm install and things start working - it takes 2-3 minutes to install all the packages and the node_modules folder is indeed created.</p>
  
  <p>What is happening here? What am I doing wrong? Why doesn't npm install work at build time, but then it works at run time?</p>