Docker and CI/CD · Senior · Question 18 of 75
In a monorepo, why might changing one package rebuild every app's Docker image?
- 1Docker can't build images from inside a monorepo
- ✓Correct answer: Each image copies the whole repo and the root lockfile
- 3Layer caching is disabled for workspaces by npm
Explanation
Any change invalidates COPY . .. Pruning to the app's dependency subset (for example turbo prune) gives each image a minimal context and lockfile.