Separating Build and Runtime
Multi-stage builds use multiple FROM instructions. A builder stage can contain compilers, development dependencies, and source code, while the final stage copies only the runtime artifacts.
This often produces smaller images with a reduced attack surface and fewer unnecessary packages.
ADVERTISEMENT