To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.
上面會提示 Worker 要下的指令,接著切換到 node2node3 下指令
$ eval $(docker-machine env node2) $ docker swarm join --token SWMTKN-1-3dmqscpgn6jwxk5o7zlmum5i2655um6bv1lgmtcztp48h4fh4n-bgmembhgaok4lhjzo2adxwsho 192.168.99.100:2377 This node joined a swarm as a worker. $ eval $(docker-machine env node3) $ docker swarm join --token SWMTKN-1-3dmqscpgn6jwxk5o7zlmum5i2655um6bv1lgmtcztp48h4fh4n-bgmembhgaok4lhjzo2adxwsho 192.168.99.100:2377 This node joined a swarm as a worker.
到此,Swarm 的環境已算初始化完成了,接著到 Manager 開始啟動 Service
$ docker service create --name web -p 8000:80 nginx:alpine 4r0x9rts2adklf3tt9816av50
Scaling
$ docker service scale web=30 web scaled to 30
Update
$ docker service update --image nginx:latest web web