简体   繁体   中英

How does Docker Swarm start a container

For Docker Swarm, the Swarm manager runs on master node while swarm agent runs on slave node. I'm interested in the steps of starting a container. There are two options:

  1. Swarm manager starts containers directly through Docker remote API.
  2. Swarm manager asks Swarm agent to start container, then Swarm agent ask local Docker daemon to start container.

Personally, I think the first one is right. But I'm not sure...

Swarm agents don't have access to the Docker daemon, they are only there to communicate via etcd, consul or zookeeper with the master. So the first one is correct. They agent registers the host with the discovery service and from then on the manager can access it via the daemon listening on a TCP port.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM