Multi-stage builds hutumia stages nyingi za FROM katika Dockerfile moja — kujenga programu katika stage moja (na zana zote za ujenzi) na kunakili tu artifacts za mwisho katika stage ya mwisho safi na ndogo. Hii hutoa images za uzalishaji ndogo zaidi na salama zaidi.
Tatizo: zana za ujenzi huvimbisha image
Building an app needs build tools (compilers, dev dependencies, SDKs), but the
FINAL image shouldn't include them:
→ they bloat the image (larger size, slower deploys)
→ they increase the attack surface (more software = more vulnerabilities)
→ You want only the built artifact + its runtime in the final image.
