Blog_Banner_Asset
    Homebreadcumb forward arrow iconBlogbreadcumb forward arrow iconFull Stack Developmentbreadcumb forward arrow iconIntroduction to Docker: What is, Architecture, Workflow

Introduction to Docker: What is, Architecture, Workflow

Last updated:
27th Apr, 2020
Views
Read Time
8 Mins
share image icon
In this article
Chevron in toc
View All
Introduction to Docker: What is, Architecture, Workflow

History of Virtualization

Not so long ago from now, deploying a service was a process that was both slow and painful. The process involved the writing of code by the development team and then its deployment by the operations team on metal machines. The operations team used to have their work cut out as they had to look for language compilers, libraries, and patches to make the code work.

If the process had any errors or bugs, it would have to start all over again – the development team would fix the bugs or errors, and the operations team would again begin deploying the code.

Check out our free courses to get an edge over the competition.

Things got a little better when Hypervisors were developed. So, what are Hypervisors? These are a collection of virtual machines (VMs) that may be continuously be running or switched off at regular intervals, especially when not in use. Virtual machines definitely helped by accelerating the process of the fixing of errors and the deployment of code, but they still had a few issues. Docker containers came as the real game-changers. They even addressed the issues that existed in virtual machines.

Ads of upGrad blog

Read: Kubernetes Vs. Docker: Primary Differences

What is Docker?

It is an open-source platform that is used by developers across the globe to run, package, and distribute applications. Docker makes the process of the encapsulation of applications from the first step to the last, very easy and efficient. To understand Docker in a better manner, you will have to understand what containers are and how they work. 

Check out upGrad’s Advanced Certification in Blockchain

A container is nothing but a stand-alone, lightweight, and executable package of a part of the software that comes with everything that is required to run it. Containers are in no way dependent on platforms. So, Docker is compatible both with Windows and Linux-based machines. Also, you can even run Docker on a virtual machine, if the need arises. The basic objective that Docker aims to achieve is to let developers use distributed architecture to run microservice applications.  

Unlike virtual machines that used to perform the abstraction of hardware, Docker goes a level up and performs abstraction of a different set of resources at the OS level. This provides several benefits, including separation of infrastructure and portability of applications amongst others. In other words, unlike virtual machines that used to abstract the hardware server, Docker’s container-based approach works by abstracting the OS core. This is a great alternative to virtualization that leads to the faster creation of lightweight instances. Docker is available in two versions:

Enterprise Edition (EE):

This version is specifically designed for IT teams and enterprise development. This version is used to develop, ship, and run applications.

Explore our Popular Software Engineering Courses

Community Edition (CE):

This version is used by individuals and small teams that are exploring container-based apps or getting started with Docker. 

Check out upGrad’s Advanced Certification in Cyber Security

Read: Full Stack Project Ideas and Topics

Docker Workflow

In this section, we will focus on the Docker Engine as well as its different components. This will help us in better understanding how Docker works before we move on to Docker architecture. Docker Engine is the power that enables developing to perform various functions using this container-based app. You can use the components that are listed below to build, package, ship, and run applications.

Explore Our Software Development Free Courses

1. Docker Daemon

It is the background process that continuously works to help you manage images, storage volumes, networks, and containers. It is always looking for Docker API requests to process them. 

2. Docker CLI

It is an interface client that interacts with Docker Daemon. It helps developers simplify the process of managing container instances. It is one of the primary reasons why developers prefer Docker over other similar applications

3. Docker Engine Rest API

It facilitates interactions between Docker daemon and applications. An HTTP client is usually required to access these APIs. 

In-Demand Software Development Skills

Docker Architecture

Docker architecture is a client-server based architecture. It has three major components that are mentioned below:

  1. Docker host
  2. Docker client
  3. Docker registry
  4. Docker objects

In the initial phase, the Docker client interacts with the daemon, which is responsible for performing much of the work that goes into developing, running, and distributing Docker containers.

Docker daemon and the client can either run on a single system or the developer can use a remote daemon to connect it with a local Docker client. Rest API is used to establish communication between Docker daemon and client. This can be either done over a network interface or UNIX sockets.

Let’s now discuss Docker architecture components in detail.

Also read: Why Become a Full Stack Developer?

1. Docker Host

A Docker host is responsible for running the Docker daemon. Docker Daemon entertains API requests, including docker build and docker run amongst others. It also manages images, networks, containers, and other Docker objects. Daemons can communicate with each other to manage different Docker services. 

2. Docker Client

It is nothing but the method that users use to interact with Docker. The Docker client sends our requests, such as docker run, and Docker builds to Docker daemon. A very important feature of Docker client is that it can communicate with several daemons. 

3. Docker Registry

A registry is a server-side application that is scalable and stateless. It not only stores Docker images but lets developers distribute them as well. Docker provides us with the flexibility to create our own images, or there are public registries available that we can make use of. These registries include Docker Cloud and Docker Hub amongst others.

Docker’s configuration is such that it always turns to Docker Hub and other public registries to look for images. However, we have the option of creating our own registry. So, we can pull out the required images using our own registries with the help of docker run and docker pull commands. Docker push command pushes the required image to the registry that we created. 

4. Docker Objects

We use and create several objects while using Docker. These objects include containers, images, plugins, volumes, networks, and others. 

5. Docker Images

Ads of upGrad blog

A Docker image is nothing but a read-only template that provides us with the instruction required to create a container. On many occasions, one image has a connection with another image. What differentiates two images is the added layer of customization. To put it differently, an image can also be defined as an immutable snapshot of a container. Images are small, lightweight, and fast.

6. Docker Containers

Let’s follow a different approach to understand Docker containers. So, if an image could be used for representing a class, a container could be its instance. In other words, a container is a runtime object. We can create, start, move, stop, or delete containers with the help of Docker CLI or API. Containers can also be attached to storage and connected to one or more than one network. Depending on the current state of a container, we can also create a new image. 

Read our Popular Articles related to Software Development

Conclusion

Now that you know what Docker architecture and its components are, you are in a better position to understand the rise in its popularity. It simplifies infrastructure management and helps make instances faster, lighter, and more resilient. 

If you’re interested to learn more about full stack coding, check out upGrad & IIIT-B’s PG Diploma in Full-stack Software Development which is designed for working professionals and offers 500+ hours of rigorous training, 9+ projects, and assignments, IIIT-B Alumni status, practical hands-on capstone projects & job assistance with top firms.

Profile

Arjun Mathur

Blog Author
Arjun is Program marketing manager at UpGrad for the Software development program. Prior to UpGrad, he was a part of the French ride-sharing unicorn "BlaBlaCar" in India. He is a B.Tech in Computers Science from IIT Delhi and loves writing about technology.

Frequently Asked Questions (FAQs)

1Q1. What are the differences between Docker and virtual machine?

Docker is an open-source technology based on the concept of containers which are nothing but the user's space within the operating system. A container is a collection of processes that are separated from the remaining system and executed from a specific image that provides the necessary files to support these processes. On the other hand, a virtual machine is not based on the concept of containers; it is used to virtualize the hardware of servers. Virtual machines consist of the user's space and kernel space within the operating system. Each virtual machine comes with its own operating system and apps and shares hardware from the host system.

2Q2. Is a container a kind of virtual machine?

The concept of virtual machines was implemented by executing a software application on a physical server, such that it emulates a specific hardware system. Each virtual machine consists of its own guest operating system. Containers are executed on a physical server and its host operating system, thereby sharing the libraries, binaries, and host operating system kernel. Containers offer a means to run isolated virtual machines on a single host operating system or server. Containerization was introduced to minimize management overhead. Containers and virtual machines are starkly different in many ways. The prime differences lie in the speed, flexibility, and portability offered by containers.

3Q3. What is the difference between Kubernetes and Docker?

Kubernetes is a highly sophisticated and robust toolset that helps automate various life cycle tasks of a software application. It selects where containers must be placed for optimal computing resources. It also automatically helps repair and revive containers in the event of their failure. On the other hand, a docker is a software utility that is employed to package and execute containers. Dockers essentially help in the management and development of standard containers. Docker technology ensures that containers contain all components (like codes, binaries, and libraries) required to execute in isolation.

Explore Free Courses

Suggested Blogs

How to Rename Column Name in SQL
46648
Introduction We are surrounded by Data. We used to store information on paper in enormous file organizers. But eventually, we have come to store it o
Read More

by Rohan Vats

04 Mar 2024

Android Developer Salary in India in 2024 [For Freshers & Experienced]
900965
Wondering what is the range of Android Developer Salary in India? Software engineering is one of the most sought after courses in India. It is a reno
Read More

by Rohan Vats

04 Mar 2024

7 Top Django Projects on Github [For Beginners & Experienced]
50999
One of the best ways to learn a skill is to use it, and what better way to do this than to work on projects? So in this article, we’re sharing t
Read More

by Rohan Vats

04 Mar 2024

Salesforce Developer Salary in India in 2024 [For Freshers & Experienced]
908377
Wondering what is the range of salesforce salary in India? Businesses thrive because of customers. It does not matter whether the operations are B2B
Read More

by Rohan Vats

04 Mar 2024

15 Must-Know Spring MVC Interview Questions
34519
Spring has become one of the most used Java frameworks for the development of web-applications. All the new Java applications are by default using Spr
Read More

by Arjun Mathur

04 Mar 2024

Front End Developer Salary in India in 2023 [For Freshers & Experienced]
902189
Wondering what is the range of front end developer salary in India? Do you know what front end developers do and the salary they earn? Do you know wh
Read More

by Rohan Vats

04 Mar 2024

Method Overloading in Java [With Examples]
25538
Java is a versatile language that follows the concepts of Object-Oriented Programming. Many features of object-oriented programming make the code modu
Read More

by Rohan Vats

27 Feb 2024

50 Most Asked Javascript Interview Questions & Answers [2024]
3834
Javascript Interview Question and Answers In this article, we have compiled the most frequently asked JavaScript Interview Questions. These questions
Read More

by Kechit Goyal

26 Feb 2024

OOP Concepts and Examples That Every Programmer Should Know
25126
In this article, we will cover the basic concepts around Object-Oriented Programming and discuss the commonly used terms: Abstraction, Encapsulation,
Read More

by Rohan Vats

26 Feb 2024

Schedule 1:1 free counsellingTalk to Career Expert
icon
footer sticky close icon