What is Docker? Simply Explained by Shradha Ma'am

Apna College
27 Jun 202419:32

Summary

TLDRThe video script delves into Docker, a platform essential for software engineers and developers, emphasizing its role in the development process. It discusses the problems Docker solves, such as environment setup inconsistencies and dependency management across different machines. The script explains Docker's containerization concept, the benefits of portability and lightweight nature of containers, and the distinction between Docker and virtual machines. It also covers basic Docker commands and the process of pulling and running Docker images, illustrating the practical use of Docker with examples.

Takeaways

  • 😀 Docker is an essential part of the modern software development process, especially for working software engineers or full-stack developers.
  • 🔧 Docker was first encountered by many when working with a specific project, and it helps solve problems related to environment setup and application deployment.
  • 👥 The script discusses the common issues faced by developers when setting up the same environment across different machines, such as manual errors and version inconsistencies.
  • 📦 Docker provides a way to package applications and their dependencies into a single unit, known as a container, which can be easily shared and deployed.
  • 🚀 Containers are lightweight and portable, which means they can run on any machine without the need for specific system changes, addressing the 'it works on my machine' problem.
  • 💾 Docker images are like blueprints that define how containers should be built and behave, similar to the relationship between a class and its objects in object-oriented programming.
  • 🔄 Docker Hub serves as a platform for sharing Docker images, much like GitHub for code, allowing developers to download and use images created by others.
  • 🛠 The script covers basic Docker commands, such as 'docker pull' to download images and 'docker run' to create and start containers from those images.
  • 🔍 Docker containers can be run in interactive mode, allowing developers to execute commands and interact with the container as if they were working directly on the host system.
  • 🔗 Docker containers are separate from the host system, ensuring that local development does not interfere with the host's environment and applications.
  • 🛑 The script also touches on the differences between Docker and virtual machines, highlighting Docker's efficiency and lighter system requirements compared to full virtualization.

Q & A

  • What is Docker and why is it essential for developers?

    -Docker is a platform that helps developers create, deploy, and run applications in containers. It is essential because it simplifies the development process by ensuring consistency across different environments and reducing the 'it works on my machine' problem.

  • What problems does Docker solve in the development process?

    -Docker solves issues related to environment inconsistencies, dependency management, and the replication of application environments across different machines. It allows developers to package their applications and dependencies into a single unit, which can be easily shared and run across different systems.

  • How does Docker differ from a virtual machine?

    -Docker differs from a virtual machine by virtualizing only the application layer rather than the entire operating system. This makes Docker containers lightweight, fast, and more portable compared to virtual machines.

  • What is the concept of a Docker container?

    -A Docker container is a lightweight, standalone, and executable package that includes everything needed to run an application, such as code, runtime, system tools, libraries, and settings.

  • What are the key properties of Docker containers?

    -The key properties of Docker containers include portability and lightweight nature. They can be easily shared and run on any machine, and they are quick to build, update, and destroy.

  • What is a Docker image and how is it related to containers?

    -A Docker image is an executable file with instructions on how to create a container. It serves as a blueprint from which multiple containers can be built and run.

  • How can Docker help in managing dependencies for an application?

    -Docker helps manage dependencies by packaging them along with the application into a container. This ensures that the application runs consistently across different environments without the need to manually install dependencies on each system.

  • What is Docker Hub and what role does it play in the Docker ecosystem?

    -Docker Hub is a cloud-based registry service that allows users to link code and images, store and distribute Docker images, and collaborate with others. It is a central repository where developers can share and download Docker images.

  • How can a developer set up Docker on their local machine?

    -Developers can set up Docker on their local machine by downloading and installing Docker Desktop from the official Docker website. Once installed, they can use Docker commands to manage images and containers.

  • What command is used to pull a Docker image from Docker Hub?

    -The 'docker pull' command is used to download a Docker image from Docker Hub to the local system.

  • How can developers interact with a running Docker container?

    -Developers can interact with a running Docker container using the 'docker run' command in interactive mode (using the '-it' flag), which allows them to execute commands within the container as if they were running them on their local machine.

Outlines

00:00

😀 Introduction to Docker in Software Development

The script begins with an introduction to Docker, emphasizing its importance in the software development process, especially for working professionals such as software engineers, full-stack developers, and DevOps engineers. It discusses the challenges faced in setting up development environments and the problems Docker solves, such as dependency management and environment consistency across different machines. The paragraph also hints at running basic Docker commands to understand its practical applications.

05:00

📦 Understanding Docker Containers and Their Benefits

This paragraph delves into the concept of Docker containers, explaining them as a way to package applications and their dependencies into a single unit. It highlights the portability of containers, their lightweight nature, and the ease with which they can be built, updated, and destroyed. The script also touches on the ability to include different versions of tools within containers, thus allowing for diverse development environments to coexist on the same system without conflict.

10:01

🛠️ Docker Images and Practical Usage of Docker

The script explains Docker images as executable files containing instructions on how to create a container. It compares Docker images to a blueprint, similar to how a class in object-oriented programming provides a template for creating objects. The paragraph discusses the process of sharing Docker images with a development team and the ease of building containers from these images. It also covers the practical steps of setting up Docker Desktop, downloading Docker, and the initial interface users will interact with for managing Docker images and containers.

15:03

🔄 Docker Hub and Container Interaction

This section introduces Docker Hub as a platform for sharing Docker images, akin to GitHub for code. It describes the process of pulling images from Docker Hub and converting them into running containers. The script provides a step-by-step guide on how to pull the 'Hello World' image, run it as a container, and interact with the container to produce output. It also explains the lightweight nature of Docker images and the ease of converting them into containers, showcasing the simplicity of using Docker for development purposes.

💻 Inside the Docker Container Environment

The final paragraph demonstrates the interactive aspect of Docker containers, showing how to enter a running container and perform operations within it, such as using the command line to navigate directories and create new files. It illustrates the practicality of Docker for development, allowing developers to work within a consistent and isolated environment that matches the production setup. The paragraph concludes with a comparison between Docker and virtual machines, highlighting Docker's efficiency and lightweight nature in virtualizing the application layer.

Mindmap

Keywords

💡Docker

Docker is an open-source platform designed for creating, deploying, and running applications in containers. It's central to the video's theme as it discusses the importance of Docker in software engineering and development processes. The script mentions Docker as an essential part of the environment, especially for working software engineers, full-stack developers, and DevOps engineers.

💡Containers

Containers, in the context of the video, refer to lightweight, standalone, and executable packages that include everything needed to run an application. They are a core concept explained in the script, highlighting how Docker helps in creating containers that can be easily shared and deployed across different systems, ensuring consistency and reducing environment setup issues.

💡Virtual Machines

Virtual Machines (VMs) are software-based simulations of physical computers, which run their own operating systems and applications. The script contrasts VMs with Docker containers to emphasize Docker's efficiency and portability. VMs are heavier and slower compared to containers, as they virtualize the entire system including the operating system, whereas Docker containers share the host system's kernel.

💡Docker Hub

Docker Hub is a cloud-based registry service that allows users to link code and images, work with collaborators, and build and share their applications. The script refers to Docker Hub as a platform for uploading and downloading Docker images, which are then used to create containers on various systems, facilitating the sharing of applications and their environments among developers.

💡Docker Images

Docker images are the templates from which Docker containers are instantiated. They contain the necessary instructions and components to build a container. The video script describes Docker images as being lightweight and essential for creating multiple containers, emphasizing their role in the portability and consistency of application environments.

💡Docker Commands

Docker commands are used to interact with Docker containers and images. The script mentions basic Docker commands such as 'docker pull' to download images from Docker Hub and 'docker run' to create and start a container from an image. These commands are fundamental for practical use and understanding of Docker operations.

💡Development Environment

A development environment in the script refers to the setup required for developers to build and test applications. The video discusses the challenges of setting up consistent development environments across different machines, which Docker helps to solve by packaging the application and its dependencies into a container.

💡Portability

Portability, as discussed in the script, is the ability to transfer an application and its environment from one system to another without modification. Docker enhances portability by allowing containers to be created and run on any system that supports Docker, regardless of the underlying operating system or hardware architecture.

💡Dependencies

Dependencies in the script refer to the libraries, frameworks, or other software components that an application relies on to function. The video explains how manually setting up dependencies for an application can be error-prone and how Docker simplifies this process by including all necessary dependencies within the container.

💡DevOps

DevOps is a set of practices that combines software development (Dev) and IT operations (Ops) to shorten the system development lifecycle and provide continuous delivery of value to end users. The script touches on how Docker is beneficial for DevOps engineers, as it streamlines the process of deploying applications in various environments, thus facilitating continuous integration and deployment.

💡Docker Desktop

Docker Desktop is the desktop version of Docker, which provides a user interface for managing Docker containers and images. The script mentions Docker Desktop as the software that users download to set up Docker on their local machines, allowing them to interact with Docker Hub and manage their containers and images.

Highlights

Docker is an essential part of the modern development process, especially for software engineers and full-stack developers.

Docker was first encountered when working with a project, highlighting the need for understanding what Docker is and why it's needed.

Docker differs from a virtual machine by virtualizing the application layer, making it lighter and more efficient.

The concept of containers is introduced as a way to package applications and their dependencies into a single unit.

Containers are portable and can be shared easily between different machines without the need for replicating the environment.

Docker images are like blueprints that define how the containers should be built and run.

Docker Hub serves as a platform for sharing Docker images, similar to GitHub for code.

The 'docker pull' command is used to download images from Docker Hub, making them available locally.

The 'docker run' command is fundamental for creating and running containers based on the images.

Containers are lightweight, making them easy to build, update, and destroy.

Docker solves the problem of environment consistency across different machines and during deployment.

The process of setting up dependencies manually can lead to errors, which Docker helps to avoid by packaging them with the application.

Docker can handle multiple applications with different dependency requirements simultaneously without conflicts.

Docker Desktop serves as the user interface for managing Docker images and containers.

The Docker engine is the core component that performs all the tasks related to building, running, and distributing containers.

Docker is faster and more efficient compared to virtual machines, which can be resource-intensive.

Virtual machines virtualize the entire system, including the operating system, whereas Docker virtualizes only the application layer.

Docker's lightweight nature allows for faster startup and execution of applications within containers.

The demonstration of running a simple 'Hello World' container illustrates the ease of using Docker for application deployment.

Docker's interactive mode allows users to run commands and make changes within a running container, similar to a local development environment.

The practical demonstration of using Docker commands to pull, run, and interact with containers provides hands-on insights into Docker's capabilities.

Transcripts

play00:00

हाय एवरीवन एंड वेलकम टू अपना कॉलेज एंड

play00:01

टुडे वी आर गोइंग टू अंडरस्टैंड डॉकर अब

play00:03

डॉकर इज़ एन एसेंशियल पार्ट ऑफ़ दी एंटायस

play00:06

प्रोसेस स्पेशली अगर हम एक वर्किंग

play00:08

सॉफ्टवेयर इंजीनियर हैं या फिर अगर हम एक

play00:10

फुल स्टैक डेवलपर बैक एंड डेवलपर या डेप्स

play00:12

इंजीनियर हैं अब जब भी हम डॉकर की बात

play00:14

करते हैं आई पर्सनली फर्स्ट एनकाउंटर्ड

play00:16

डॉकर व्हेन आई वाज वर्किंग विद द

play00:30

व्हाट इज डॉकर व्हाई डू वी नीड डॉकर एंड

play00:33

हाउ इज डॉकर डिफरेंट फ्रॉम अ वर्चुअल मशीन

play00:35

इसके साथ में वी आर आल्सो गोइंग टू रन सम

play00:37

बेसिक डॉकर कमांड जिससे हमें प्रैक्टिकली

play00:39

पता चल जाए कि प्रैक्टिकल सिनेरियो के

play00:41

अंदर डॉकर को हम किस तरीके से यूज़ कर

play00:43

सकते हैं अब डॉकर को समझने से पहले यह

play00:45

समझना बहुत जरूरी है कि पूरे डेवलपमेंट

play00:47

प्रोसेस के अंदर ऐसी क्या प्रॉब्लम थी

play00:50

जिसको सॉल्व करने के लिए डॉकर को आना पड़ा

play00:52

तो जब भी हम अपने एक नॉर्मल डेवलपमेंट

play00:54

प्रोसेस की बात करते हैं तो वो कुछ इस

play00:56

तरीके का दिखता है फॉर एग्जांपल हमारे पास

play00:58

हमारी कोई मशीन है लेट्स से अजूम इट्स अ

play01:30

कर रहे हैं पर एक टीम के अंदर तो हमारी

play01:31

टीम के अंदर ऑलरेडी बहुत सारे मेंबर्स हैं

play01:34

जो इस सेम एप्लीकेशन के ऊपर काम कर रहे

play01:35

हैं और हमारी टीम को जॉइन करता है एक नया

play01:38

डेवलपर अब लेट्स अज्यू कि ये जो नया

play01:40

डेवलपर है इसके पास मैक ऑपरेटिंग सिस्टम

play01:42

है अब दिस पर्सन दिस डेवलपर आल्सो नीड्स

play01:45

टू सेट अप द सेम एनवायरमेंट टू रन द सेम

play01:48

एप्लीकेशन इन देयर सिस्टम तो उसके लिए

play01:51

सारी डिपेंडेंसीज इन्हें भी इंस्टॉल करनी

play01:53

पड़ेंगी तो उसके लिए लेट्स सपोज इन्होंने

play01:55

सबसे पहले नोड को इंस्टॉल किया पर क्योंकि

play01:57

यह थोड़ा सा लेटेस्ट वर्जन इंस्टॉल करना

play01:59

चाह रहे थे तो लेट्स सपोज इन्होंने नोड का

play02:01

वर्जन 20 इंस्टॉल कर लिया या 21 कर लिया

play02:04

या रेडिस के लिए जब इन्होंने इंस्टॉल किया

play02:06

तो दे इंस्टॉल्ड वर्जन से इस तरीके से

play02:09

पूरा एनवायरमेंट इन्होंने सेटअप कर दिया

play02:11

और अब ये यह एप्लीकेशन अपने सिस्टम पे रन

play02:13

करने की कोशिश कर रहे हैं अब ये जो पूरा

play02:15

प्रोसेस हमने किया इसके अंदर मल्टीपल

play02:16

प्रॉब्लम्स आ सकती हैं यानी जब भी हम किसी

play02:19

एक मशीन का पूरा का पूरा लोकल एनवायरमेंट

play02:22

किसी दूसरी मशीन के अंदर रिप्लिकेट करने

play02:24

की कोशिश करते हैं तो उस प्रोसेस के अंदर

play02:26

सबसे पहली प्रॉब्लम तो यही आ सकती है कि

play02:28

क्योंकि एक मैनुअल प्रोसेस है जिसमें

play02:30

एक-एक करके एक-एक करके हम डिपेंडेंसीज को

play02:32

सेटअप कर रहे हैं तो इसके अंदर मैनुअल एरर

play02:34

हो सकता है सेकंड प्रॉब्लम ये आ सकती है

play02:36

कि हो सकता है कि हमारी एप्लीकेशन या उसका

play02:38

कोई स्पेसिफिक पार्ट नोड का वर्जन 16 ही

play02:41

यूज़ कर रहा हो उसके अलावा वह किसी दूसरे

play02:43

वर्जन पे रन ही ना करें तो उस केस में तो

play02:45

इस एप्लीकेशन को जब हम इस सेकंड सिस्टम

play02:52

ma3 प्रॉब्लम यह आ सकती है कि

play02:59

नहीं है कि वो सेम कमांड्स हमारे मैक

play03:01

सिस्टम के अंदर या हमारे विंडोज सिस्टम के

play03:03

अंदर वर्क करेंगे तो इस तरीके की कई सारी

play03:06

प्रॉब्लम्स है जो डेवलपर्स ने एनकाउंटर की

play03:08

जब भी डेवलपर्स बड़ी टीम्स के अंदर काम

play03:10

करते हैं क्योंकि ये तो हो गया एक टीममेट

play03:13

जिसके लिए हो सकता है हमारे पास

play03:14

प्रॉब्लम्स आए तो उनको हम रिजॉल्व कर दें

play03:16

और एनवायरमेंट को कंपलीटली वहां पर सेटअप

play03:18

करा दें पर अगर एक बड़ी डेवलपमेंट टीम काम

play03:21

कर रही होती है तो उसके अंदर बहुत सारे

play03:23

डेवलपर्स होते हैं बहुत सारे डेवलपर्स

play03:25

जॉइन भी कर रहे होते हैं तो इतने सारे

play03:27

डेवलपर्स के ऊपर रिलाई करना कि दे विल बी

play03:29

एबल टू रेकेट दैट लोकल डेवलपमेंट

play03:31

एनवायरमेंट इन देयर ओन सिस्टम्स वो भी

play03:33

बिना किसी एरर के वो भी हसल फ्री होकर वो

play03:36

बहुत बड़ी बात हो जाती है दैट इज जनरली

play03:38

नॉट पॉसिबल और ये जो प्रॉब्लम है ये सिर्फ

play03:40

लोकल एनवायरमेंट के अंदर नहीं आती अगर इसी

play03:42

सेम प्रोजेक्ट को कल को अगर हम डिप्लॉयड

play03:45

सम प्रोडक्शन सर्वर तो सर्वर के अंदर भी

play03:48

हमें ये सेम एनवायरमेंट जो है उसे

play03:50

रिप्लिकेट करना पड़ेगा तो डेप्लॉयमेंट के

play03:52

टाइम पर भी बहुत सारे हमारे पास इश्यूज आ

play03:54

सकते हैं बहुत सारे एरर्स आ सकते हैं तो

play03:56

ये जो प्रॉब्लम है ये प्रैक्टिकली

play03:57

एनकाउंटर की कई सारे डेवलपर्स ने अपनी

play04:00

बड़ी लार्ज डेवलपमेंट टीम्स के अंदर एंड

play04:02

आल्सो अगर आपने कोई भी ओपन सोर्स का

play04:04

प्रोजेक्ट अपने लोकल सिस्टम के अंदर सेटअप

play04:06

करने की कोशिश की है तो यह सेम प्रॉब्लम्स

play04:08

आपने भी एनकाउंटर की होंगी सो बेसिकली दिस

play04:10

गिव राइज़ टू द क्लासिकल प्रॉब्लम इन टेक

play04:12

इट वर्क्स ऑन माय मशीन तो इस प्रॉब्लम को

play04:15

सॉल्व करने के लिए हमारे पास आया डॉकर अब

play04:18

डॉकर इज़ अ रियली इंपॉर्टेंट प्लेटफॉर्म

play04:21

जो हमें कंटेनर्स बनाने में हेल्प करता है

play04:24

अब यह कंटेनर्स क्या होते हैं बेसिकली

play04:26

कंटेनर्स का कांसेप्ट कहता है कि अब हम

play04:28

अपनी एप्लीकेशन को यानी उसके कोड को एंड

play04:31

उसकी डिपेंडेंसीज को एक सिंगल यूनिट के

play04:34

अंदर पैकेज बनाकर अपने फेलो डेवलपर्स को

play04:36

दे सकते हैं या फिर उन्हें एज अ सिंगल

play04:39

पैकेज एज अ सिंगल यूनिट हम डायरेक्टली

play04:43

डिप्लॉयड सिस्टम्स के अंदर या इंडिविजुअल

play04:46

प्रोडक्शन सर्वर्स के अंदर इस तरीके से

play04:48

डिपेंडेंसीज को एक-एक करके रेप्ट नहीं

play04:50

करना पड़ेगा इस चीज का हम पूरा एक बंडल

play04:53

बना देंगे जिस बंडल को हम दूसरे सिस्टम्स

play04:56

के साथ शेयर कर सकते हैं दूसरे डेवलपर्स

play04:57

के साथ शेयर कर सकते हैं और इसी बंडल इसी

play05:00

पैकेज को हम कह देते हैं अपना कंटेनर तो

play05:02

इस कंटेनर के अंदर हम बेसिकली अपनी

play05:04

डिपेंडेंसीज अपने जितने भी टूल्स हैं कि

play05:06

नोड का हमें कौन सा वर्जन रखना है रेस्का

play05:08

में कौन सा वर्जन रखना है वो सारी चीजें

play05:11

पहले से ही सेटअप कर सकते हैं और सबसे

play05:13

अच्छी बात कंटेनर्स की यह है कि ये किसी

play05:15

भी मशीन के ऊपर वर्क करते हैं अब चाहे

play05:17

हमारा एक डेवलपर मैक सिस्टम पे वर्क कर

play05:19

रहा हो दूसरा डेवलपर

play05:29

नीड टू मेक एनी चेंजेज टू देयर सिस्टम टू

play05:32

रन द स्पेसिफिक कंटेनर और डॉकर क्या है

play05:34

डॉकर बेसिकली व प्लेटफार्म है या कह सकते

play05:37

हैं वो सर्विस है जो हमें कंटेनर्स बनाने

play05:40

में हेल्प करते हैं जो इन कंटेनर्स को

play05:42

बिल्ड करने में इन्हें डिस्ट्रॉय करने में

play05:44

इन्हें अपडेट करने में हमें हेल्प करते

play05:45

हैं अब कंटेनर्स की दो काफी खास

play05:47

प्रॉपर्टीज हैं सबसे पहला हमारे कंटेनर्स

play05:50

पोर्टेबल होते हैं पोर्टेबल कहने का मतलब

play05:52

है इन्हें एक मशीन से दूसरी मशीन के अंदर

play05:53

शेयर किया जा सकता है तो इट बिकम इजियर टू

play05:56

शेयर कोड एज वेल एज डिपेंडेंसीज विद आवर

play05:58

डेवलपमेंट टीम एंड उस उसके साथ में

play06:00

कंटेनर्स जो होते हैं वह बहुत लाइट वेट

play06:02

होते हैं लाइट वेट कहने का मतलब है कि

play06:04

बहुत आसानी से बिल्ड हो जाते हैं बहुत

play06:06

आसानी से अपडेट हो जाते हैं बहुत आसानी से

play06:08

डिस्ट्रॉय हो जाते हैं और हम चाहे तो अगर

play06:10

हमें एडिशनल डिपेंडेंसीज इंस्टॉल करनी है

play06:12

अपनी एप्लीकेशन के लिए तो उन्हें हमें सेम

play06:15

कंटेनर के अंदर इंस्टॉल कर सकते हैं मतलब

play06:18

ये अगर हमारी लोकल मशीन है तो उस लोकल

play06:21

मशीन का एक पार्ट हमारा कंटेनर हो जाएगा

play06:23

पर ये कंटेनर कंप्लीट सेपरेट होगा हमारी

play06:26

लोकल मशीन से तो पहले लेट्स सपोज कि हमारे

play06:29

किसी इंडिविजुअल सिस्टम के अंदर नोड का

play06:32

वर्जन 16 इंस्टॉल्ड था तो अगर इस सिस्टम

play06:34

के अंदर हम दो एप्लीकेशन साथ में बिल्ड कर

play06:36

रहे हैं तो जनरली एक लोकल सिस्टम के अंदर

play06:38

जो भी नोड का वर्जन होगा उसके ऊपर हम सेम

play06:40

एप्लीकेशन बिल्ड कर रहे होंगे पर क्योंकि

play06:42

अब विद द हेल्प ऑफ कंटेनर्स ये जो

play06:44

इंडिविजुअल एप्स हैं अब इन दोनों को हम दो

play06:47

कंटेनर्स के अंदर बिल्ड कर सकते हैं तो हो

play06:49

सकता है इस एक ऐप के अंदर हम वर्जन 16 यूज

play06:52

करें और इस सेकंड ऐप के अंदर हम वर्जन 20

play06:54

यूज करें तो वो चीज अब एक साथ अपने लोकल

play06:57

सिस्टम के अंदर कर पाना पॉसिबल हो जाता है

play06:59

एंड ली ऐसा तो है नहीं कि किसी एक

play07:01

एप्लीकेशन को बिल्ड करने के लिए हमारे पास

play07:02

सिर्फ दो-तीन डिपेंडेंसीज होती हैं जो

play07:04

हमें इंस्टॉल करनी पड़ती है बहुत सारी

play07:06

डिपेंडेंसीज होती हैं जिसमें कहीं भी एरर

play07:08

हो सकता है पर अगर इन सारी डिपेंडेंसीज को

play07:10

कंटेनर के अंदर हम प्री पैकेज करके अपने

play07:12

डेवलपमेंट टीम को दे देते हैं तो वो जो

play07:14

एक-एक करके एक-एक करके डिपेंडेंसी इंस्टॉल

play07:17

करने वाला प्रोसेस होता है उसके मैनुअल

play07:19

एरर से हम अपने डेवलपर्स को बचा सकते हैं

play07:21

अब ये तो हमने समझ लिया कि डॉकर कंटेनर

play07:23

क्या होता है पर जब भी हम डॉकर की बात कर

play07:24

रहे होते हैं देयर इज वन इंपॉर्टेंट टर्म

play07:26

दैट वी नीड टू अंडरस्टैंड व्हिच इज कॉल्ड

play07:29

डॉकर इमेज अब डॉकर इमेज कोई फोटो नहीं

play07:31

होती डॉकर इमेज इज एक्चुअली एन

play07:34

एग्जीक्यूटेबल फाइल जिस फाइल के अंदर

play07:36

इंस्ट्रक्शंस होती हैं कि किस तरीके से

play07:38

हमारा एक कंटेनर बनना चाहिए तो यूजिंग वन

play07:42

इमेज हम बहुत सारे मल्टीपल कंटेनर्स बना

play07:45

सकते हैं तो जब भी हम कहते हैं कि अपनी

play07:47

डेवलपमेंट टीम के साथ हम कंटेनर शेयर

play07:49

करेंगे तो एगजैक्टली हम कंटेनर शेयर नहीं

play07:51

कर रहे होते एगजैक्टली हम अपने प्रोजेक्ट

play07:54

या अपनी एप्लीकेशन का क्या करते हैं पहले

play07:56

डॉकर इमेज बनाते हैं फिर यह डॉकर इमेज

play07:58

हमारे इंडि विजुअल टीम मेंबर्स के साथ

play08:00

शेयर होती है और फिर हर कोई इस डॉकर इमेज

play08:03

की हेल्प से अपना कंटेनर बिल्ड कर लेता है

play08:05

सिस्टम के अंदर तो जब हम डॉकर इमेज की बात

play08:07

कर रहे हैं इमेज इज बेसिकली लाइक अ

play08:09

स्टैटिक स्क्रीनशॉट और अ स्टैटिक स्नैपशॉट

play08:13

ऑफ व्हाट द कोड एंड द डिपेंडेंसीज और

play08:15

व्हाट द लोकल डेवलपमेंट एनवायरमेंट इज

play08:17

गोइंग टू लुक लाइक बेसिकली डॉकर इमेज और

play08:20

डॉकर कंटेनर्स के बीच में वही सेम

play08:22

रिलेशनशिप है जो एक क्लास और ऑब्जेक्ट्स

play08:25

के बीच में होता है हमें पता है कि क्लास

play08:27

क्या करती है क्लास एक ब्लू ब्लूप्रिंट

play08:29

देती है कि हमारी हर एक ऑब्जेक्ट कैसी

play08:31

दिखनी चाहिए तो यूजिंग अ सिंगल क्लास हम

play08:34

अपने कोड के अंदर ऑब्जेक्ट ओरिएंटेड

play08:36

प्रोग्रामिंग के अंदर बहुत सारी

play08:37

ऑब्जेक्ट्स को बिल्ड कर सकते हैं तो क्लास

play08:39

क्या करती है ऑब्जेक्ट्स कैसी दिखनी चाहिए

play08:41

उसका एक ब्लूप्रिंट प्रिपेयर करती है

play08:44

क्लास हमारे कोड के अंदर कोई एज सच

play08:45

रिसोर्सेस नहीं लेती मेमोरी के अंदर

play08:48

मेमोरी लेवल पे जाके जो मेमोरी ऑक्यूपाइड

play08:50

पाई करता है वो हमारी ऑब्जेक्ट्स होती है

play08:53

वैसे ही डॉकर इमेज एक ब्लूप्रिंट देती है

play08:56

कि हमारे कंटेनर्स कैसे दिखने चाहिए वो

play08:58

कंटेनर्स आप मैक ओ के अंदर भी बना सकते

play09:00

हैं वो कंटेनर आप

play09:29

के अंदर हम पूरा डेवलपमेंट प्रोसेस जो है

play09:31

वो कर रहे होते हैं तो कंटेनर इज बेसिकली

play09:33

लाइक एन इंस्टेंस ऑफ दिस डॉकर इमेज तो ये

play09:36

तो अब हमने

play09:41

थोरेट्स भी एक डॉकर इमेज से अपने कंटेनर

play09:44

को क्रिएट करने की कोशिश करते हैं अब अपने

play09:46

लोकल सिस्टम पर डॉकर को सेटअप करने के लिए

play09:48

द इजस्ट वे इज टू सेट अप डॉकर डेस्कटॉप यू

play09:52

कैन गो टू दिस लिंक एंड यू कैन डाउनलोड

play09:54

डॉकर फॉर योर सिस्टम अगर आप मैक पर हैं यू

play09:56

कैन डाउनलोड यूजिंग द मैक ऑप्शन नहीं तो

play09:57

हम विज या

play09:59

डाउनलोड कर सकते हैं तो डॉकर डेस्कटॉप को

play10:01

जब हम डाउनलोड करेंगे तो हमारे पास इस

play10:03

तरीके का कुछ इंटरफेस या सॉफ्टवेयर खुल

play10:05

रहा होगा इसी के ऊपर हम अपने डॉकर के

play10:07

इमेजेस एंड कंटेनर्स के साथ डील करते हैं

play10:09

अब डॉकर की जितनी भी इमेजेस हैं उनके लिए

play10:11

एक प्लेटफॉर्म है डॉकर हब जो ऑलरेडी

play10:13

एजिस्ट करता है जैसे हम गिट हब के ऊपर

play10:15

अपने कोड्स को अपलोड करते हैं वैसे ही

play10:17

डॉकर हब के ऊपर हम अपनी डॉकर इमेजेस को

play10:19

अपलोड कर सकते हैं और उन इमेजेस को हमारे

play10:22

जो डेवलपर्स हैं दूसरे लोग हैं टीममेट्स

play10:24

हैं वो डाउनलोड कर सकते हैं और अपने

play10:26

सिस्टम के अंदर इमेज से अपने कंटेनर को

play10:28

क्रिएट कर सकते हैं

play10:29

फॉर एग्जांपल अगर हम डॉकर हब पर जाएं तो

play10:32

डॉकर हब कुछ इस तरीके से दिखेगा जिसके

play10:34

अंदर हमने सबसे सिंपल एक इमेज खोली हुई है

play10:36

व्हिच इज कॉल्ड हेलो वर्ल्ड तो हम क्या

play10:38

करेंगे हम इस इमेज को सबसे पहले अपने

play10:40

सिस्टम के अंदर पुल करेंगे एंड देन वी आर

play10:42

गोइंग टू टर्न दिस इमेज इनटू अ डॉकर

play10:44

कंटेनर तो इमेज को पुल करने के लिए जनरली

play10:47

इमेजेस के साथ में आपको पुल कमांड मिल

play10:49

जाएगी व्हिच इज द डॉकर पुल कमांड हम डॉकर

play10:52

पुल लिखते हैं एंड उसके बाद जिस भी इमेज

play10:54

को हम पुल करना चाहते हैं तो वो इमेज

play10:56

इंटरनेट से यानी डॉकर हब से हमारे सिस्टम

play10:59

के अंदर हमारे डॉकर डेस्कटॉप के अंदर आ

play11:01

जाएगी तो वो करने के लिए वी हैव टू कॉपी

play11:03

दिस वी हैव टू गो टू आवर टर्मिनल और

play11:06

टर्मिनल के अंदर वी कैन डायरेक्टली राइट

play11:08

डॉकर पुल हेलो वर्ल्ड जैसे ही इसे एंटर

play11:11

करेंगे वैसे ही हमारा सिस्टम क्या करेगा

play11:13

इट विल स्टार्ट पुलिंग द इमेज फ्रॉम द

play11:15

इंटरनेट और अब वो इमेज हमारे डॉकर के अंदर

play11:17

अवेलेबल है तो डॉकर डेस्कटॉप पर इमेजेस के

play11:19

अंदर पहले जो ये स्क्रीन खाली थी अब यहां

play11:22

पर हमारे पास हेलो वर्ल्ड नाम की एक इमेज

play11:24

आ गई है एंड इफ यू लुक एट द इमेज साइज इट

play11:26

इज वेरी स्मॉल इसीलिए बोला जाता है कि

play11:28

डॉकर की जो इमेजेस हैं या डॉकर के जो

play11:30

कंटेनर्स हो वो जनरली बहुत लाइट वेट होते

play11:32

हैं तो डॉकर इमेज को आप डाउनलोड करोगे

play11:34

वैसे तो इस इमेज का साइज केबीज में है जो

play11:36

बहुत छोटा होता है पर जनरली जो भी इमेजेस

play11:38

हम डाउनलोड करते हैं उनका साइज एमबीज के

play11:40

अंदर होता है अब इस इमेज को रन करने के

play11:43

लिए वी हैव टू कन्वर्ट इट इनटू अ कंटेनर

play11:46

किसी भी इमेज को अगर हम कंटेनर के अंदर

play11:48

कन्वर्ट करना चाहते हैं तो हम लिखते हैं

play11:51

डॉकर रन एंड फिर अपनी इमेज का नाम हमारी

play11:55

इमेज का नाम है हेलो वर्ल्ड तो बेसिकली हम

play11:57

क्या कर रहे हैं हम इस इमेज को रन करने की

play11:59

बात कर रहे हैं रन करने का मतलब है इसे

play12:01

कंटेनर के अंदर कन्वर्ट करना और उस कंटेनर

play12:04

को रन करना तो अभी डॉकर के अंदर हमारे

play12:06

कंटेनर्स के अंदर कंपलीटली एम्टी विंडो है

play12:08

जैसे ही हम इस कमांड को रन करेंगे क्या

play12:11

हुआ ऑटोमेटिक हमारे लिए हमारा कंटेनर रन

play12:14

हो गया और यह मैसेज हमारे लिए आकर प्रिंट

play12:16

हो गया जो हमारी उस इमेज ने ही प्रिंट

play12:18

करवाया है मतलब कंटेनर रन हुआ और कंटेनर

play12:20

ने ये मैसेज प्रिंट करवाया है और अगर हम

play12:22

कंटेनर्स वाली विंडो पर आएंगे तो हमारे

play12:24

लिए दिखा रहा है कि ये कंटेनर एक क्रिएट

play12:26

हुआ है ये इस कंटेनर की आईडी है इस कंटेनर

play12:29

को एक रैंडम नाम दे दिया गया है एंड वी

play12:31

हैव ऑलरेडी एग्जिट फ्रॉम द कंटेनर या तो

play12:34

कंटेनर रनिंग स्टेट में होता है रन करने

play12:36

का मतलब है कि कंटेनर के अंदर प्रोसेसेस

play12:38

अभी चल रहे हैं अभी वो कंटेनर स्टॉप या

play12:40

क्लोज नहीं हुआ है एग्जिट करने का मतलब है

play12:42

कि कंटेनर पूरा रन कर गया और अब हम उस

play12:44

कंटेनर से एग्जिट भी कर गए हैं तो ये पूरा

play12:46

प्रोसेस कैसे हुआ वो हमारे टर्मिनल पे

play12:47

ऑलरेडी लिखा हुआ है द डॉकर क्लाइंट

play12:49

कॉन्टैक्टेड द डॉकर डी मन बेसिकली ये डी

play12:52

मन हमारे डॉर डेस्कटॉप का ही सबसे

play12:54

इंपॉर्टेंट पार्ट है डॉर डेस्कटॉप तो क्या

play12:56

है हमारा यूआई है जिसके थ्रू हम अपने बटन

play12:59

को क्लिक करते हैं अपने सारे काम करने की

play13:00

कोशिश करते हैं पर इंटरनली डॉकर डेस्कटॉप

play13:03

का जो कोर है वो हमारा डॉकर डीम है जो

play13:06

हमारे लिए सारे के सारे काम करता है तो उस

play13:08

डॉकर डीम ने इंटरनेट से हेलो वर्ल्ड वाली

play13:10

इमेज को पुल किया फ्रॉम डॉकर हब और उसने

play13:13

उस इमेज की हेल्प से एक नया कंटेनर क्रिएट

play13:16

किया फिर इस कंटेनर ने हमारे लिए कुछ

play13:18

आउटपुट प्रोड्यूस किया और वो कौन सा

play13:19

आउटपुट है वो वो आउटपुट है जिसे हम अभी

play13:21

रीड कर रहे हैं वी आर करेंटली रीडिंग इट

play13:23

और उसी सेम आउटपुट को हमारे टर्मिनल के

play13:25

अंदर प्रिंट करवा दिया गया अब हमारे

play13:27

कंटेनर का ये जो आउटपुट है ये हमें एक और

play13:29

और इमेज सजेस्ट कर रहा है व्हिच इज उबुंटू

play13:30

तो हम चाहे तो इस उबुंटू वाली इमेज को भी

play13:33

पुल कर सकते हैं लेट्स क्लियर दिस एंड हम

play13:35

डायरेक्टली लिख सकते हैं डॉकर रन हाइन

play13:38

आईटी अब डैश आईटी स्टैंड्स फॉर इंटरेक्ट

play13:41

मोड बेसिकली हम अपनी इमेज को पुल करके

play13:44

अपने कंटेनर को इंटरेक्ट मोड में रन करना

play13:46

चाहते इंटरेक्ट मोड हम इसलिए यूज़ कर रहे

play13:48

हैं क्योंकि जब हमारे ये उबुंटू वाला

play13:49

कंटेनर रन करेगा तो उबुंटू के अंदर इस

play13:52

सिस्टम के अंदर कंटेनर के अंदर हम कुछ

play13:54

कमांड्स को रन करना चाहते हैं प्रैक्टिकल

play13:56

सिनेरियो उस के अंदर इंटरेक्ट मोड्स को हम

play13:58

तब यूज़ कर सकते हैं जब हमारे कंटेनर के

play14:00

अंदर कुछ ऐसी एप्लीकेशन है जिसको हमें कुछ

play14:02

कमांड्स की हेल्प से कुछ टर्मिनल सीआई

play14:04

कमांड्स की हेल्प से रन करने की जरूरत है

play14:06

तो यहां हम रन कर सकते हैं अपनी कमांड को

play14:08

सबसे पहले उसने डिटेक्ट किया कि ये इमेज

play14:10

लोकली हमारे पास अवेलेबल नहीं है तो इस

play14:12

इमेज को पुल किया जा रहा है एंड फाइनली

play14:13

हमारे लिए हमारी पूरी इमेज डाउनलोड हो गई

play14:16

और अब हम अगर चेक करेंगे तो डॉकर डेस्कटॉप

play14:18

के अंदर इमेजेस के अंदर वी हैव वन मोर

play14:20

इमेज विद द नेम उबुंटू ये इमेज ऑलरेडी इन

play14:23

यूज़ है कंटेनर्स के अंदर देखेंगे तो

play14:26

ऑटोमेटिक इस इमेज के लिए एक कंटेनर रन

play14:28

करना स्टार्ट कर गया है एंड दिस कंटेनर इज

play14:31

रनिंग राइट नाउ ये एग्जिट नहीं हुआ है ये

play14:33

रन कर रहा है और यहां पर इस कंटेनर की ये

play14:36

आईडी है और ये इसे रैंडम नाम दे दिया गया

play14:38

है अब अगर हम अपने टर्मिनल पर देखेंगे तो

play14:41

अभी हम अपने कंप्यूटर के लोकल सिस्टम के

play14:43

अंदर नहीं है अभी हमारा टर्मिनल कहां पे

play14:45

पॉइंट कर रहा है अभी हमारा टर्मिनल पॉइंट

play14:47

कर रहा है कंटेनर के अंदर मतलब यहां पर हम

play14:49

रूट डायरेक्ट्रीएंट्री

play14:59

हम उबुंटू की इमेज को रन कर रहे हैं तो अब

play15:01

हम चाहे तो हमारे ये जो उबुंटू कंटेनर है

play15:03

इसी के अंदर हम कुछ-कुछ चेंजेज कर सकते

play15:05

हैं जैसे फॉर एग्जांपल इसके अंदर हम एलएस

play15:07

कमांड रन करेंगे तो ये सारे हमारे पास

play15:09

फोल्डर्स आ गए हम चाहें तो वी कैन क्रिएट

play15:11

अ न्यू

play15:15

डायरेक्ट्रीएंट्री

play15:17

हमारे पास आ गई तो इस तरीके से कई सारे

play15:20

डिफरेंट डिफरेंट चेंजेज हैं जो किए जा

play15:21

सकते हैं हम पूरी फाइल्स बना सकते हैं

play15:23

पूरा का पूरा डेवलपमेंट अब इस कंटेनर के

play15:25

अंदर किया जा सकता है यानी नॉर्मली जो

play15:27

डेवलपमेंट हम अपने लो सिस्टम के अंदर करते

play15:29

थे अब वह सारा का सारा प्रोसेस हमारे

play15:32

कंटेनर के अंदर शिफ्ट हो जाएगा और यह सारी

play15:34

चीजें सेटअप करने के लिए सारी चीजें

play15:36

इंस्टॉल करने के लिए हमें ज्यादा कोई हसल

play15:38

नहीं करना पड़ा सिंपली हमने डॉकर डेस्कटॉप

play15:40

को डाउनलोड किया और एक सिंपल सी कमांड को

play15:42

रन किया तो इतना सिंपल होता है डॉकर

play15:43

इमेजेस एंड डॉकर कंटेनर्स को यूज़ करना तो

play15:46

आई कैन सिंपली एग्जिट फ्रॉम दिस कंटेनर

play15:48

एंड इस कंटेनर को हम स्टॉप कर सकते हैं

play15:50

यूजिंग डॉकर स्टॉप और फिर अपने कंटेनर की

play15:53

आईडी इफ वी वांट वी कैन यूज़ दिस आईडी

play15:55

नहीं तो हम चाहे तो यह नाम भी लिख सकते

play15:57

हैं लेट्स कॉपी एंड यूज दिस स्पेसिफिक

play16:01

आईडी तो अब हमारे लिए हमारा डॉकर कंटेनर

play16:03

स्टॉप हो गया है यहां पर आएंगे तो स्टेटस

play16:04

में दिखा रहा है एग्जिट अब जनरली अगर हम

play16:06

डॉकर को यूज़ करते हैं उसे सीखने की कोशिश

play16:08

करते हैं तो अ लॉट ऑफ बिगिनर्स कंफ्यूज

play16:11

डॉकर विद वर्चुअल मशीनस वर्चुअल मशीनस एंड

play16:14

डॉकर्स आर कंपलीटली सेपरेट थिंग्स अब उसे

play16:16

समझने के लिए लेट्स ट्राई टू अंडरस्टैंड

play16:18

कि हमारी मशीनस किस तरीके से वर्क करती

play16:20

हैं अगर हम कोई भी सिस्टम यूज़ कर रहे हैं

play16:22

चाहे वो विंडोज है चाहे वो मैक है चाहे वो

play16:28

डेटिंग सिस्टम का एक कर्नल होता है एंड

play16:30

उसके ऊपर हमारे पास एप्लीकेशन लेयर होती

play16:32

है एंड इसी एप्लीकेशन लेयर के ऊपर हमारी

play16:34

डिफरेंट एप्स वर्क कर रही होती हैं जैसे

play16:36

हमारा ब्राउजर हो गया या और भी कंप्यूटर

play16:38

की डिफरेंट एप्स हो गई तो डॉकर एगजैक्टली

play16:39

क्या करता है डॉकर होस्ट ऑपरेटिंग सिस्टम

play16:42

का ही कर्नल यूज करता है बस वो एप्लीकेशन

play16:45

लेयर को वर्चुलाइज कर देता है मतलब नाउ

play16:48

इंस्टेड ऑफ लुकिंग एट द पप और द सिस्टम जो

play16:50

एक्चुअली हमारी लोकल मशीन के अंदर था अब

play16:52

हमारे पास एक और दूसरा एनवायरमेंट आ गया

play16:54

जिसके अंदर अब डॉकर कंटेनर के अंदर की जो

play16:56

एप्स हैं उसके अंदर का जो पूरा सिस्टम है

play16:58

एनवायरन है उसे अब हम देख पा रहे हैं

play17:00

लेकिन क्योंकि वर्चुअल मशीनस के पास अपना

play17:03

खुद का कर्नल होता है तो वर्चुअल मशीनस

play17:05

एप्लीकेशन लेयर को तो वर्चुअल इज करती हैं

play17:08

उसके साथ में होस्ट ऑपरेटिंग सिस्टम के

play17:10

कर्नल को भी

play17:12

वर्चुअल मशीनस की बात करते हैं वर्चुअल

play17:14

मशीनस एक तरीके से पूरे के पूरे ऑपरेटिंग

play17:17

सिस्टम को वर्चुलाइज कर रही होती है अब

play17:19

क्योंकि डॉकर सिर्फ एप्लीकेशन लेयर को

play17:20

वर्चुलाइज करने का काम करता है दैट इज

play17:23

व्हाई डॉकर इज लाइटवेट तो जनरली जब भी हम

play17:25

डॉकर इमेजेस का साइज देखेंगे तो वो कुछ

play17:27

एमबीज में होगा जबकि अगर हम एक्चुअली

play17:29

वर्चुअल मशीनस को यूज़ कर रहे होंगे तो वो

play17:31

जीबीज तक हमारी साइज लिमिट को लेकर जा

play17:33

सकते हैं इसके साथ में डॉकर इज आल्सो

play17:35

फास्टर एज कंपेरर टू वर्चुअल मशीनस पर

play17:37

वर्चुअल मशीनस का एक एडेड बेनिफिट ये होता

play17:39

है कि वर्चुअल मशीनस हर एक सिस्टम के साथ

play17:41

कंपैटिबल होती हैं चाहे वो

play17:59

तो सिर्फ

play18:28

तो डॉकटर डेस्कटॉप एगजैक्टली ऐसा क्या

play18:30

करता है वह हमारे सिस्टम के अंदर एक लाइट

play18:33

वेट हाइपरवाइजर की लेयर ऐड करता है व्हिच

play18:36

इंटरनली यूसेज अ लाइट वेट

play18:58

सिस्टम पर हैं तो फिर हम अपने

play19:28

इतना ही मिलते हैं नेक्स्ट सेशन के अंदर

play19:29

टिल देन कीप लर्निंग एंड कीप एक्सप्लोरिंग

Rate This

5.0 / 5 (0 votes)

Related Tags
DockerContainersSoftware DevelopmentDevOpsVirtualizationDeploymentEnvironment SetupDeveloper ToolsAutomationInfrastructureTech Tutorial