மல்டி-ஸ்டேஜ் பில்ட்ஸ் ஒரே Dockerfile-ல் பல FROM ஸ்டேஜ்களைப் பயன்படுத்துகின்றன — அப்ளிகேஷனை ஒரு ஸ்டேஜில் (அனைத்து பில்ட் டூல்ஸுடன்) பின்னர் இறுதி கலைப்பொருட்களை மட்டுமே சுத்தமான, குறைந்தபட்ச இறுதி ஸ்டேஜில் நகலெடுக்கிறது. இது மிகவும் சிறிய, பாதுகாப்பான உৎপாதன images உற்பத்தி செய்கிறது.
சிக்கல்: பில்ட் டூல்ஸ் 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.
