2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018

08/19/2016: Docker Swarm 1.12 on VirtualBox

This post shows the steps I followed to run Docker Swarm 1.12 on VirtualBox.

Start the cluster

docker-machine create --driver virtualbox pi1
docker-machine create --driver virtualbox pi2
docker-machine create --driver virtualbox pi3
docker-machine create --driver virtualbox pi4
docker-machine create --driver virtualbox pi5

List the IP Addresses

for i in `seq 1 5`; do
  echo "HOST: pi$i IP: $(docker-machine ip pi$i)";

Start Swarm Master

export SWARM_ID=$(docker-machine ssh pi1 docker swarm --advertise-addr=$(docker-machine ip pi1) init)

Start Agents

export SWARM_JOIN_CMD=$(docker-machine ssh pi1 docker swarm join-token worker | tail -n 4 | head -n 3 | tr --delete '\\')

for i in `seq 2 5`; do
  docker-machine ssh pi$i $SWARM_JOIN_CMD

L#ist swarm nodes

eval $(docker-machine env pi1)
docker node ls

Exercise the swarm

eval $(docker-machine env pi1)
docker service create --name ping alpine ping
docker service ps ping
docker service update --replicas 10 ping
docker service rm ping

Shutdown the cluster

eval $(docker-machine env --unset)
docker-machine env --unset
for i in `seq 0 5`; do
  docker-machine rm -y pi$i;

subscribe via RSS