In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
How the Docker architecture works
Friends who are not familiar with Docker can refer to the blog post: introduction to Docker and detailed explanation of installation and configuration.
First of all, Docker is developed based on the Go language, and works based on the Cmax S structure, as shown in the figure:
As can be seen from the picture:
(1) users use Docker Client to establish communication with Docker Daemon and send requests to the latter
(2) as the main part of Docker architecture, Docker Daemon first provides the function of Server so that it can accept requests from Docker Client, and then Engine (engine) performs a series of tasks within Docker, each of which exists in the form of a Job.
(3) during the operation of Job, when a container image is needed, download the image from Docker Registry (docker repository), and store the downloaded image in the form of Graph (image) through graphdriver (Image Management driver). When you need to create a network environment for Docker, create and configure the Docker container network environment through networkdriver (Network Management driver). When you need to restrict Docker container operations such as running resources or executing user instructions, it is done through execdriver (execution Management driver).
(4) libcontainer (container library) is an independent container management package. Networkdriver and execdriver implement specific operations on containers through libcontainer. After executing the command to run the container, an actual Docker container is running. The container has an independent file system, an independent and secure running environment, and so on.
Function of each module (1) docker client
Docker client is the client that users use to establish communication with docker daemon in docker architecture. Users can make many requests to manage docker container through docker command line tool.
After the docker client sends the container management request, the docker daemon accepts and processes the request. When the docker client receives the returned request and simply processes it, the complete life cycle of the docker client is over.
(2) docker daemon
Docker daemon is a system process resident in the background in docker architecture, and its function is to receive and process requests sent by docker client. The daemon starts a server,server payload in the background to accept the request sent by docker client; after accepting the request, server finds the corresponding handler (processor) to execute the request through routing and distribution scheduling.
(3) docker server
Docker server is a server dedicated to docker client in docker architecture. The function of this server is to accept and dispatch requests sent by docker client.
(4) engine
Engine is not only the running engine of Docker architecture, but also the core module of Docker running. It acts as a Docker container repository and manipulates and manages these containers by executing job.
(5) job
A Job can be regarded as the most basic work execution unit within the Engine in the Docker architecture, and every work that Docker can do can be abstracted as a job.
(6) docker registry
Docker Registry is a repository for container images. The container image is loaded to initialize the file schema and directory of the container when the container is created.
(7) Graph
Graph acts as the custodian of downloaded container images and the recorder of the relationship between downloaded container images in the Docker architecture. On the one hand, Graph stores local file system images with version information, on the other hand, it also records the relationship between all file system images through GraphDB.
(8) driver
Driver is the driver module in Docker architecture. Through Driver driver, Docker can customize the execution environment of Docker container. Because in the life cycle of Docker operation, not all the actions of users are aimed at the management of Docker container, but also about the acquisition of Docker operation information, the storage and recording of Graph and so on. Therefore, in order to distinguish the management of Docker containers from the internal business logic of Docker Daemon, a Driver layer driver is designed to take over all these requests.
In the implementation of Docker Driver, there are three types of drivers:
Graphdriver is mainly used to manage container images, including storage and acquisition. That is, when the user needs to download the specified container image, graphdriver stores the container image in the specified local directory; when the user needs to use the specified container image to create the rootfs of the container, graphdriver obtains the specified container image from the local image storage directory; the purpose of networkdriver is to complete the configuration of the Docker container network environment, including creating a bridge for the Docker environment when Docker starts. Create a dedicated virtual network card device for the Docker container when it is created; assign IP and ports to the Docker container and map the port to the host, set the container firewall policy, etc. Execdriver, as the execution driver of the Docker container, is responsible for creating the container running namespace, for the statistics and restrictions on the use of container resources, and for the actual operation of the processes within the container. In the implementation of execdriver, the LXC driver can be used to call the interface of LXC to manipulate the configuration and life cycle of the container, but now execdriver uses the native driver by default and does not depend on LXC. This is specifically reflected in the ExecDriverflag parameter loaded during Daemon startup, which has been set to "native" in the configuration file; (9) libcontainer
Libcontainer is a library designed and implemented in the Docker architecture using the go language. The original design intention is that the library can directly access the container-related API in the kernel without relying on any dependencies. It is because of the existence of libcontainer that Docker can directly call libcontainer, and ultimately manipulate the container's namespace, cgroups, apparmor, network devices, firewall rules and so on.
(10) docker container
Docker container (Docker container) is the ultimate form of service delivery in Docker architecture. Docker customizes the corresponding Docker container according to the user's needs and instructions. The user specifies the container image to enable the Docker container to customize the file system such as rootfs; the user specifies the quota of computing resources to make the Docker container use the specified computing resource; the user configures the network and its security policy to make the Docker container have an independent and secure network environment; and the user makes the Docker container perform the specified work by specifying the command to run.
If you want to have a more in-depth study of Docker, you can refer to the blog post: the principle of Docker architecture and its simple use.
-this is the end of this article. Thank you for watching-
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.