When the architect started assigning me such a task, I thought it was nested inside Docker to create Docker, but it was not, after all, the final form of the architecture that was to be created and launched Docker at one level managed.
Here we can see the Docker boot, there will be a dockerd daemon, a containerd management process. Note that the dockerd process bindings are listening on the/var/run/docker.sock file, and it is clear that the unix_local sockets used for communication between Docker. Here you can think of Dockerd as a server, and the client can be two: 1. Our Docker command tool, command interaction 2.docker Remote API,HTTPS Protocol interaction The goal of these two client connections is actually/var/run/docker.sock, OK, the solution is here. As a first step, we only need-v/var/run/docker.sock:/var/run/docker.sock when we create Docker. I have tried, if you mount the entire directory directly/var/run, then the creation of Docker is not up, there is no limit to the creation of docker–net, whether it is host or bridge. Second step, After mapping Docker.sock to Docker, in this Docker to create and start a new Docker, you have to have clients to send requests to the host host's Dockerd server, at which point we only need to copy the Docker command tool to Docker. The summary, in fact, is that before the Docker Command tool client on the host host, the Dockerd server daemon is also on the host host. Later, we knew that they were communicating through/var/run/docker.sock, so we mapped the file to host hosts and Docker to ensure their communication. Then put the Docker command tool client to Docker, then you can.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.