sh Docker Swarm
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh Docker Swarm相关的知识,希望对你有一定的参考价值。
docker swarm init
docker stack deploy -c docker-compose.yml getstartedlab
Create multiple machines
docker-machine create --driver virtualbox myvm1
docker-machine create --driver virtualbox myvm2
Remotly
docker-machine ssh myvm1 "docker swarm init"
Being on machine
docker swarm init --advertise-addr 192.168.99.100
docker-machine ssh myvm2
Copy files
docker-machine scp docker-compose.yml myvm1:~
Deploy Stack
docker-machine ssh myvm1 "docker stack deploy -c docker-compose.yml getstartedlab"
List all running containers
docker-machine ssh myvm1 "docker stack ps getstartedlab”
docker-machine stop $(docker-machine ls -q) # Stop all running VMs
docker-machine rm $(docker-machine ls -q)
docker-machine ssh myvm1 "docker stack ps getstartedlab”
docker stack ps
docker stack ls
docker stack ps getstartedlab
docker swarm init --advertise-addr 192.168.99.100
docker stack deploy --compose-file docker-stack.yml vote
docker stack services vote
docker stack rm vote
verify that the swarm is still active on both nodes
docker node ls
以上是关于sh Docker Swarm的主要内容,如果未能解决你的问题,请参考以下文章
sh Docker Swarm
sh 重新启动Docker swarm的virtualbox
sh 在DigitalOcean上设置Docker Swarm多主机群集
sh 在DigitalOcean上设置Docker Swarm多主机群集
sh 使用compose file和auth标志部署docker swarm
sh 在数字海洋上运行docker-compose与docker-machine和docker-swarm