Multi-stage builds bruker flere FROM-stadier i én Dockerfile — bygger applikasjonen i ett stadium (med alle byggeverktøyene) og kopier kun de endelige artefaktene til et rent, minimalt sluttstadium. Dette produserer mye mindre, mer sikre produksjonsiminutt.
Problemet: byggeverktøy fyller opp iminuttet
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.
