DockerDocker
DCA · Question #33
DCA Question #33: Real Exam Question with Answer & Explanation
The correct answer is B: Optimizing images by copying artifacts selectively from previous stages. Multi-stage builds are primarily used to optimize Docker images by reducing their size and attack surface.
Submitted by the_admin· Apr 18, 2026Image Creation, Management, and Registry
Question
What is the purpose of multi-stage builds?
Options
- ABetter logical separation of Dockerfile instructions for better readability
- BOptimizing images by copying artifacts selectively from previous stages
- CBetter caching when building Docker images
- DFaster image builds by allowing parallel execution of Docker builds
Explanation
Multi-stage builds are primarily used to optimize Docker images by reducing their size and attack surface.
Common mistakes.
- A. While multi-stage builds can improve the logical organization of a Dockerfile, their main purpose is not just readability but concrete image optimization.
- C. Although caching is leveraged during multi-stage builds, it's a general Docker build feature; the primary purpose of multi-stage builds is not better caching, but image size reduction through artifact selection.
- D. Multi-stage builds execute stages sequentially; they do not inherently allow for parallel execution of Docker builds, which would typically require separate build processes.
Concept tested. Docker multi-stage builds for image optimization
Reference. https://docs.docker.com/build/building/multi-stage/
Topics
#Multi-stage builds#Dockerfile#Image optimization#Image size
Community Discussion
No community discussion yet for this question.