Docker and CI/CD · Middle · Question 11 of 75
What does RUN --mount=type=cache,target=/root/.npm npm ci give you?
- 1A guarantee that
npm ciruns only once per machine forever - ✓Correct answer: A persistent download cache shared between builds, not in the image
- 3A cache layer that is pushed to the registry with the image
Explanation
Even when the layer is rebuilt, packages already downloaded are reused. The cache lives on the builder, so on ephemeral CI runners it needs exporting.