This content originally appeared on DEV Community and was authored by Rakib Hasan
For most beginners, Docker's architecture is hard to understand. In this blog post, you will learn everything about Docker architecture and how it works, as easily as possible, with proper visual aids.
What is Docker?
Docker is a platform for building, running and shipping application in consistent manners. Docker Solve the famous problem “It works on my machine!”
Now let’s talk about Docker Engine
Docker uses client
-server
architecture. That means docker has its client
component that to the server
component using the REST API
.
Server is called Docker Engine, set in the background and takes care of building and running the docker containers.
Take a look at the image below
Technically a container is a process. It’s a special process, we are not going to discuss about this process in this blog, For now we should now that unlike virtual machines (VM), containers don’t container full-blown ‘operating system’. Instead, All containers on a host shared the operating system (OS) of the host. More accurately, All its container share kernels of the host.
What is Kernel ?
A kernel is a core of a operating system (OS), like engine of car. A kernel manages applications and hardware resources.
Every OS (mac, windows ,Linux) has its won kernels/engines. And this kernels has different API’s. That’s why we can not run mac application on windows or Linux. Because, under the hood this applications is to talk to the kernel underline “OS”. So that means on Linux machines, we can only run Linux containers, Because this container need Linux. On a windows machine however, we can run both ( windows + Linux) container because windows 10 shift with a custom build Linux kernel. Docker on mac uses light weight Linux virtual machine (VM).
Now let’s see docker architecture all together
Let's explain some terms that we have seen in the docker architecture.
What is docker daemon ?
The Docker daemon (dockerd
) listens for Docker API requests and manages Docker objects such as images, containers, networks, and volumes. A daemon can also communicate with other daemons to manage Docker services.
What is docker client ?
The Docker client (docker
) is the primary way that many Docker users interact with Docker. When you use commands such as docker run
, the client sends these commands to docker daemon dockerd
, which carries them out. The docker
command uses the Docker API. The Docker client can communicate with more than one daemon.
Docker registries
A Docker registry stores Docker images. Docker Hub is a public registry that anyone can use, and Docker looks for images on Docker Hub by default. You can even run your own private registry.
When you use the docker pull
or docker run
commands, Docker pulls the required images from your configured registry. When you use the docker push
command, Docker pushes your image to your configured registry.
This content originally appeared on DEV Community and was authored by Rakib Hasan
Rakib Hasan | Sciencx (2024-07-08T18:50:48+00:00) Understanding Docker Architecture: A Beginner’s Guide. Retrieved from https://www.scien.cx/2024/07/08/understanding-docker-architecture-a-beginners-guide/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.