title: Gitlab CI : how to cache node_modules from a prebuilt image?
body: <p>The situation is this:
  I'm running Cypress tests in a Gitlab CI (launched by vue-cli). To speed up the execution, I built a Docker image that contains the necessary dependencies.
  How can I cache node_modules from the prebuilt image to use it in the test job ?
  Currently I'm using an awful (but working) solution:</p>
  <pre><code>testsE2e:
    image: path/to/prebuiltImg
    stage: tests
    script:
      - ln -s /node_modules/ /builds/path/to/prebuiltImg/node_modules
      - yarn test:e2e
      - yarn test:e2e:report
  </code></pre>
  <p>But I think there must be a cleaner way using the Gitlab CI cache.</p>
  <p>I've been testing:</p>
  <pre><code>cacheE2eDeps:
    image: path/to/prebuiltImg
    stage: dependencies
    cache:
      key: e2eDeps
      paths:
        - node_modules/
    script:
      - find / -name node_modules # check that node_modules files are there
      - echo &quot;Caching e2e test dependencies&quot;
  
  testsE2e:
    image: path/to/prebuiltImg
    stage: tests
    cache:
      key: e2eDeps
    script:
      - yarn test:e2e
      - yarn test:e2e:report
  </code></pre>
  <p>But the job cacheE2eDeps displays a <code>&quot;WARNING: node_modules/: no matching files&quot;</code> error.
  How can I do this successfully? The Gitlab documentation doesn't really talk about caching from a prebuilt image...</p>
  <p>The Dockerfile used to build the image :</p>
  <pre><code>FROM cypress/browsers:node13.8.0-chrome81-ff75
  
  COPY . .
  RUN yarn install
  </code></pre>