* Docker for Mac
* VirtualBox
* Git
First, we'll create a cluster of three VMs with Docker Machine installed on each. In Docker Swarm terms, they'll all be "manager" nodes.
scripts/create-cluster.shForward local Docker commands to the Docker machines in the swarm.
eval $(docker-machine env node1)Take a quick look.
docker node lsThis step will download network utility images (docker-flow-swarm-listener & docker-flow-proxy - see url), a local registry to save downloading too often, a Docker Swarm visualizer tool, and a base Jenkins image - which we'll build upon.
scripts/download-tag-push-images.sh
curl $(docker-machine ip node1):5000/v2/_catalogscripts/build-push-myjenkins-image.sh
curl $(docker-machine ip node1):5000/v2/_catalog You'll need to set a couple of environment variables.
export JENKINS_USER=myname
export JENKINS_PASS=passwordOtherwise these will default to admin/admin.
scripts/deploy.shAfter deploying Jenkins to the cluster, its console should open. Log in with the credential you supplied earlier.
You can open it later by:
open "http://$(docker-machine ip node1)/jenkins"scripts/deploy-visualizer.shscripts/chaos-monkey.shOpen the visualizer.
eval $(docker-machine ip node1)
open "http://$(docker-machine env node1)/viz"The Jenkins container artifact should disappear - then reappear while transitioning through states 'preparing', then 'starting', and finally 'running' and green. It may not be on the same node as it was before.
This demonstrates that if Jenkins fails, it will be rescheduled by the swarm management system. We cannot achieve zero downtime due to its stateful nature.