Whenever you start learning any new technology, it is really important to understand the basic terminologies which make it easy to understand the technology better. So, in this short article, we’ll focus on the architecture and basic terminologies of Docker so that you can grasp it better.
The three main keywords of Docker are Develop, Ship, and Run. The docker makes developer life easy to develop the application, ship the application into the container and run it wherever they want to run. In simple terms, Docker is to create a lot of smaller boxes on a single host machine and run all of them in isolation. These smaller boxes are nothing they are called containers that share the kernel of the host machine.
The docker was released in March 2013 and since then it has become the buzzword in the market and every organization is adopting the same for modern world development.
Docker is based on the client-server architecture where the client sends a request to the server, Docker serves the request and sends the response back to the client. For example, A client sends a request to create a container, the docker server which is Docker Daemon listens to the request, full fills the request, and sends the response back to the client.
The following image represents the architecture of the Docker:
The client talks to the Docker daemon which carries out the tasks to build, run, and distribute the containers. The Docker client and Docker Daemon can run on the same system or the Docker client can communicate with the Docker Daemon which is running on the remote system. The Docker client and daemon communicate using a REST API, over UNIX sockets or a network interface.
The following are basic terminologies used in the Docker world:
A docker container is an instance of an image. A container is a sandbox that runs an application along with its dependencies. From a single image, multiple containers can be initiated on a single host machine that runs in isolation. The containers are very lightweight and have their own hostname, IP, CPU, memory, etc. The major benefit of the docker is the process isolation.
The following images show the containerization using the Docker engine and how the virtualization is being done using the Docker.
Refer to the blog to know how to create containers.
An image is just like the Java class which is used to create multiple objects (containers in the case of Docker world). Without an image nothing exists in Docker, if you have an image then only containers can be created. The images are immutable in nature and once created can’t be modified which means images are read-only. In case you want to modify the image, you have to create another image and create a container from the modified image.
The following image shows a single image is used to create multiple containers.
Docker Hub is the place (or registry) on the cloud which stores all the Docker images uploaded by a wide variety of communities and consumers (like you and me) download them and use them. You can also upload your own custom Docker images to Docker Hub which others can download and use it. So, Docker Hub is the public place that has the collection of Docker images. You can view all the images on the official website of Docker Hub.
A Docker Repository is a collection of images over the internet. A Docker Repository can be either public or private. The Docker Repository can be used to pull and push images. If the Repository is private then only authorized users can pull the images however the public repository is open to the world.
Docker is built on client/server architecture. The Docker daemon (dockerd) listens for Docker API requests (such as create, start, run, etc.) and manages Docker objects such as images, containers, networks, and volumes. A daemon can also communicate with other daemons to manage Docker services.
The Docker client is the one who issues the request to create images, containers, volumes, network, etc. The Docker daemon listens to the client’s request and does the to and fro communications.
You can look out the complete video to understand Docker, its architecture, and basic terminologies:
Subscribe to my YouTube channel to get regular updates.