Docker swarm 节点主机名相同
Docker swarm node hostnames are the same
我使用 vagrant 来管理 VirtualBox,我想使用 Docker Swarm 构建一个集群。
当我 运行 命令 docker node ls
它显示相同的主机名。另外,如果我 运行 服务,它们是 运行 并立即关闭和 运行 并关闭。
Here is the vagrant file.
Here is the docker swarm result show.
我建议安装docker-machine然后使用下面的脚本安装一个swarm
在引擎盖下它仍然使用 Virtualbox,与 vagrant 相比只是一种更 docker 友好的方式。
可能是由于在 docker-engine 之前或之后更改主机名的问题造成的:
https://github.com/docker/docker/issues/27173
在我重新启动 VM 后,HOSTNAME 列是正确的。
我使用 vagrant 来管理 VirtualBox,我想使用 Docker Swarm 构建一个集群。
当我 运行 命令 docker node ls
它显示相同的主机名。另外,如果我 运行 服务,它们是 运行 并立即关闭和 运行 并关闭。
Here is the vagrant file.
Here is the docker swarm result show.
我建议安装docker-machine然后使用下面的脚本安装一个swarm
在引擎盖下它仍然使用 Virtualbox,与 vagrant 相比只是一种更 docker 友好的方式。
可能是由于在 docker-engine 之前或之后更改主机名的问题造成的: https://github.com/docker/docker/issues/27173
在我重新启动 VM 后,HOSTNAME 列是正确的。