Docker and CI/CD · Senior · Question 66 of 75
Why should frequently changing layers come last and shared base layers stay stable?
- ✓Correct answer: Nodes already hold the base layers and pull only the small top ones
- 2Registries charge for every layer, so fewer changes cost less
- 3Docker merges every changed layer into the base layer on each push
Explanation
If all services share one base image, a deploy downloads just the app layer. Rebuilding the base for every release forces full pulls everywhere.