Docker and CI/CD · Middle · Question 1 of 75
What is the main benefit of a multi-stage build?
- 1The image is split into several smaller images that are pushed separately
- 2Each stage runs on a separate machine, so the build finishes faster
- ✓Correct answer: Build tools stay in earlier stages; the final image has only runtime files
Explanation
A builder stage installs dev dependencies and compiles; the final stage copies only the output with COPY --from=builder. Images get smaller and safer.