title: Speed up build by caching packages in Docker container
body: <p>I have this idea that I haven't completed yet. In a Dockerfile I have:</p>
  
  <pre><code>FROM node:10
  
  WORKDIR /app
  
  RUN "*cache node modules here*"
  RUN e.g. npm cache add foo bar baz
  
  COPY package.json .
  RUN npm i --cache-min 9999999 --loglevel=warn
  
  COPY . .
  
  CMD node dist
  </code></pre>
  
  <p>How can I create ultra high-performance Dockerfiles by caching some Node.js modules/package before the npm install step?</p>
  
  <p>Is there some trick that can do this?</p>