- 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
unable to find the tasks command on latest release 1.12.0.
docker@infra:~$ docker service tasks
Usage: docker service COMMAND
Manage Docker services
Options:
--help Print usage
Commands:
create Create a new service
inspect Display detailed information on one or more services
ps List the tasks of a service
ls List services
rm Remove a service
scale Scale one or multiple services
update Update a service
Run 'docker service COMMAND --help' for more information on a command.
docker@infra:
$ docker --versiondocker@infra:$ docker versionClient:
Version: 1.12.0
API version: 1.24
Go version: go1.6.3
Git commit: 8eab29e
Built: Thu Jul 28 23:54:00 2016
OS/Arch: linux/amd64
Server:
Version: 1.12.0
API version: 1.24
Go version: go1.6.3
Git commit: 8eab29e
Built: Thu Jul 28 23:54:00 2016
OS/Arch: linux/amd64
Docker version 1.12.0, build 8eab29e