Mr. Deepak Verma
Web Developer
Container क्या होता है?

Learn Docker by M-Learnify

Docker

Container क्या होता है?


Container क्या है? | Docker Explained in Hindi

Container क्या है?

Container एक lightweight और portable unit होती है, जिसमें कोई application और उसके चलने के लिए जरूरी सारे components (जैसे — code, libraries, dependencies, configuration files आदि) एक साथ पैक होते हैं।

आप इसे ऐसे समझिए — जैसे किसी सामान को भेजने के लिए हम shipping container में रखते हैं ताकि वो किसी भी जहाज, ट्रेन या ट्रक से आसानी से भेजा जा सके। उसी तरह Docker software container में App को पैक करता है ताकि वो किसी भी System (Linux, Windows, Mac) पर एक जैसी तरह से चल सके।

Container और Virtual Machine (VM) में अंतर

तुलना Container Virtual Machine (VM)
Size बहुत हल्का (MBs में) भारी (GBs में)
Boot Time कुछ सेकंड में मिनटों में
Isolation OS स्तर पर पूरा OS अलग होता है
Performance तेज़ थोड़ा धीमा
Example nginx, mysql containers VirtualBox, VMware VMs

Container कैसे काम करता है?

Docker में आप किसी Image से container बनाते हैं। (Image एक टेम्पलेट या ब्लूप्रिंट होती है।) जब आप docker run कमांड चलाते हैं, तो Docker उस Image से एक container बनाता है। वो container आपके सिस्टम के Kernel को शेयर करता है, लेकिन अपना अलग environment (filesystem, process space) रखता है।

एक छोटा उदाहरण

# Nginx server चलाने के लिए container बनाना
docker run -d -p 8080:80 nginx
⚠️ Tippadi: ऊपर दी गई कमांड एक Nginx web server को आपके सिस्टम पर पोर्ट 8080 पर चलाएगी। सुनिश्चित करें कि यह पोर्ट पहले से उपयोग में न हो।

संक्षेप में

Container = App + उसकी Dependencies + Configuration

✅ Lightweight
✅ Fast
✅ Portable

एक system पर कई containers एक साथ चल सकते हैं, बिना एक-दूसरे को disturb किए।
← Back to Courses
Course Lessons