title: Running "npm ci" when building docker image is much slower
body: <p>I tried to run <code>npm ci</code> command using the same <code>package.json</code> and <code>package-lock.json</code> files in three different environments:</p>
  
  <ul>
  <li>docker host machine - takes <strong>~27s</strong> to complete</li>
  <li>inside a docker container - takes <strong>~32s</strong> to complete</li>
  <li>during building a docker image - takes <strong>~163s</strong> to complete</li>
  </ul>
  
  <p>I wonder why it takes much more time to install packages when building an image. What the difference between running commands when building an image and when running commands inside a container manually? Perhaps it's related to the amount of resources (CPU, Memory) docker uses when building an image?</p>
  
  <p>I use the same node and npm version in all three environments. Docker host is a Windows Server 2019 VM that has 2 virtual CPUs and 2GB of memory. Docker version is <code>18.09.2</code>.</p>