Home>Article>Operation and Maintenance> What does docker daemon mean?

What does docker daemon mean?

青灯夜游
青灯夜游 Original
2021-11-29 16:42:48 11721browse

docker daemon means: Docker daemon; the main functions of daemon include image management, image construction, REST API, authentication, security, core network and orchestration.

What does docker daemon mean?

The operating environment of this tutorial: linux5.9.8 system, docker-1.13.1 version, Dell G3 computer.

What does docker daemon mean?

Docker Daemon

##Daemon is the daemon process of Docker. Docker Client communicates with Docker Damon through the command line Communicate and complete Docker related operations.

The main functions of daemon include image management, image construction, REST API, authentication, security, core network and orchestration.

Working mechanism

Docker Daemon can be thought of as accepting Docker Client requests through the Docker Server module, processing the requests in the Engine, and then creating the specified Job and run it, the role of the running process has the following possibilities: obtain the image from Docker Registry, perform localization operations of the container image through graphdriver, perform configuration of the container network environment through network driver, perform execution work inside the container through execdriver, etc. .

Modify Docker Daemon

Docker Daemon has different modification methods: command line modification, modification of startup items, modification of configuration files.

  • When you just study or use the different options of Docker Daemon once, you can use the command line. At this time, Docker Daemon is running on the front end and the log is printed directly on the terminal;

  • When the configuration of Docker Daemon is stable and is not modified frequently, you can put the Docker Daemon option in the startup item;

  • When Docker Daemon When the configuration needs to be modified regularly, the changed options can be placed in the configuration file.

Startup process

Since the startup of Docker Daemon and Docker Client are completed through the executable file docker, the startup of both The process is very similar. When the Docker executable file is run, the running code distinguishes the two through different command line flag parameters, and finally runs the corresponding parts of the two.

When starting Docker Daemon, you can generally use the following commands: docker --daemon=true; docker –d; docker –d=true, etc. Then the docker's main() function parses the corresponding flag parameters of the above commands, and finally completes the startup of the Docker Daemon.

What does docker daemon mean?

Through the flow chart of Docker Daemon, we can draw the conclusion that all work related to Docker Daemon is included in the implementation of the mainDaemon() method.

Macroscopically speaking, mainDaemon() completes the creation of a daemon process and makes it run normally.

From a functional perspective, mainDaemon() implements two parts: first, creating a Docker operating environment; second, serving the Docker Client, receiving and processing corresponding requests.

In terms of implementation details, the implementation process of mainDaemon() mainly includes the following steps:

1) Daemon configuration initialization (this part is implemented in the init() function, that is, in mainDaemon() ) is executed before running, but since this part is closely related to the running of mainDaemon(), it can be considered as a prerequisite for the running of mainDaemon();

2) Command line flag parameter check;

3) Create an engine object;

4) Set the signal capture and processing method of the engine;

5) Load builtins;

6) Use goroutine to load the daemon object and run it ;

7) Print the Docker version and driver information;

8) Create and run the "serveapi" job.

Recommended learning: "

docker video tutorial"

The above is the detailed content of What does docker daemon mean?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn