Create a swarm cluster with Virtualbox with Docker 1.12 (swarm mode) running two test services

Create a swarm cluster with Docker 1.12 swarm mode running two test services

docker 1.12.0
docker-machine 0.8.0
docker-compose 1.8.0
Kitematic 0.12.0
Boot2Docker ISO 1.12.0
VirtualBox 5.0.24

docker-machine create --driver virtualbox swarm-manager
docker-machine create --driver virtualbox swarm-node-1
docker-machine create --driver virtualbox swarm-node-2
docker-machine create --driver virtualbox swarm-node-3
docker-machine create --driver virtualbox swarm-node-4
docker-machine create --driver virtualbox swarm-node-5

docker-machine ip swarm-manager > manager_ip.txt
set /p MANAGER_IP=< manager_ip.txt

docker-machine ssh swarm-manager docker swarm-manager init --advertise-addr %MANAGER_IP%

docker-machine ssh swarm-manager docker swarm join-token --quiet manager >manager_token.txt
set /p MANAGER_TOKEN=<manager_token.txt

docker-machine ssh swarm-manager docker swarm join-token --quiet worker >worker_token.txt
set /p WORKER_TOKEN=<worker_token.txt

docker-machine ssh swarm-node-1 docker swarm join --token %MANAGER_TOKEN% %MANAGER_IP%:2377
docker-machine ssh swarm-node-2 docker swarm join --token %MANAGER_TOKEN% %MANAGER_IP%:2377
docker-machine ssh swarm-node-3 docker swarm join --token %WORKER_TOKEN% %MANAGER_IP%:2377
docker-machine ssh swarm-node-4 docker swarm join --token %WORKER_TOKEN%  %MANAGER_IP%:2377
docker-machine ssh swarm-node-5 docker swarm join --token %WORKER_TOKEN%  %MANAGER_IP%:2377

docker-machine ssh swarm-manager docker network create -d overlay aspennetwork

docker-machine ssh swarm-manager docker service create --name web --network aspennetwork --replicas 10 -p 5001:80 francois/apache-hostname

docker-machine ssh swarm-manager docker service create --replicas 3 --name helloworld alpine ping docker.com

Comments

Popular posts from this blog

Basic Send Message to MQ with Java and IBM MQ JMS

Basic Receive Message to MQ with Java and IBM MQ JMS

Creating a simple Alert / Success Message with ASP.NET/VB using Bootstrap