- manager1
- worker1
- worker2
Use docker-machine to lay down 3 x hosts on AWS using docker-engine 1.12
docker-machine create --driver amazonec2 --amazonec2-private-address-only --engine-install-url https://test.docker.com/ levenson-docker-swarm-manager1
docker-machine create --driver amazonec2 --amazonec2-private-address-only --engine-install-url https://test.docker.com/ levenson-docker-swarm-worker1
docker-machine create --driver amazonec2 --amazonec2-private-address-only --engine-install-url https://test.docker.com/ levenson-docker-swarm-worker2
On manager1
docker swarm init --listen-addr <manager1:eth0-addr>:2377
On worker1/2
docker swarm join <manager1:eth0-addr>:2377
docker node ls
ID NAME MEMBERSHIP STATUS AVAILABILITY MANAGER STATUS
2d38pr0i29f3b0ow0h124pl3t levenson-docker-swarm-worker2 Accepted Ready Active
7q62jyv94ofnr66rsp1uqa730 * levenson-docker-swarm-manager1 Accepted Ready Active Leader
8zfyhauh35avz5t25gz0j1ugy levenson-docker-swarm-worker1 Accepted Ready Active
docker service create --replicas 1 --name croc-hunter -p 8080:80 --update-delay 10s --update-parallelism 1 lachlanevenson/croc-hunter:v1
docker service tasks croc-hunter
docker service inspect croc-hunter
docker service scale croc-hunter=3
docker service tasks croc-hunter
docker service update --image lachlanevenson/croc-hunter:v2 croc-hunter
docker service tasks croc-hunter
docker service tasks croc-hunter
docker node update --availability drain levenson-docker-swarm-worker1
docker node inspect --pretty levenson-docker-swarm-worker1
docker service tasks croc-hunter
docker node update --availability active levenson-docker-swarm-worker1
docker node inspect --pretty levenson-docker-swarm-worker1
with 1.12 task sub command deprecated.