简体   繁体   English

Docker Swarm 如何启动一个容器

[英]How does Docker Swarm start a container

For Docker Swarm, the Swarm manager runs on master node while swarm agent runs on slave node.对于 Docker Swarm,Swarm 管理器运行在主节点上,而 swarm 代理运行在从节点上。 I'm interested in the steps of starting a container.我对启动容器的步骤很感兴趣。 There are two options:有两种选择:

  1. Swarm manager starts containers directly through Docker remote API. Swarm 管理器直接通过 Docker 远程 API 启动容器。
  2. Swarm manager asks Swarm agent to start container, then Swarm agent ask local Docker daemon to start container. Swarm 管理器请求 Swarm 代理启动容器,然后 Swarm 代理请求本地 Docker 守护进程启动容器。

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. Swarm 代理无法访问 Docker 守护进程,它们只能通过 etcd、consul 或 zookeeper 与 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.他们代理向发现服务注册主机,然后管理器可以通过监听 TCP 端口的守护进程访问它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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