ملٹی سٹیج بلڈز ایک Dockerfile میں متعدد FROM سٹیجز استعمال کرتے ہیں — ایک سٹیج میں ایپلیکیشن کو بنایا جاتا ہے (تمام بلڈ ٹولز کے ساتھ) اور صرف حتمی artifacts کو ایک صاف، کم سے کم حتمی سٹیج میں کاپی کیا جاتا ہے۔ یہ بہت چھوٹی، زیادہ محفوظ پروڈکشن 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.
