Docker container assembly

Starting docker1.11 version, docker container is not a simple operation initiated by docker daemon daemon, but integrates multiple components containerd, containerd-shim, runC and so on. After docker service is started, the system can view the dockerd, docker-containerd processes such command.

The container assembly described Docker
Docker the CLI (Docker)
Docker client program is a tool used to send the user request to the docker daemon (dockerd).

Docker d
dockerd as a daemon docker container management (docker daemon), and docker client daemon responsible for interaction, and management docker mirror and containers; also generally referred to as docker engine.

Containerd
containerd is a product container after standardization, the standard for compatible OCI, the container and its run-time management functions from the docker daemon peeled. In theory, if not run dockerd, can also be directly managed by the container containerd.

Containerd -shim
It is containerd component, a runtime container carrier, you can be viewed by the command corresponding to each of the docker container on the host vessel containerd -shim.

RunC
runC process is a child process containerd-shim present, runC process to find the rootfs container according to bash configuration and create a child process as the first process container. When all this is completed runC process exits, then bash process container from the runC parent process containerd-shim takeover.

Docker assembly workflow

  • docker dockerd client sends a request to create the container , dockerd will pull the mirror image of the container depot.
  • dockerd from the image corresponding to the image repository pull, and containerd request to initiate operation of the container .
  • When a request is received dockerd start containerd container will do some initialization work, then start containerd-shim process, and configuration as a parameter to it. docker-containerd responsible for managing all containers of the machine is running, and a containerd-shim process is only responsible for managing the operation of a vessel.
  • containerd-shim start runC process,runC processthe contents of the container output is fed back to containerd-shim , ultimately to docker client.

Guess you like

Origin www.cnblogs.com/zhouzhifei/p/11597066.html