At this point we've accomplished the purpose of the guide, but we might as well run a service to demonstrate how to use the swarm. Our swarm can run any number of services and they can be scaled and distributed across the nodes in our cluster according to our preferences. To begin, we can run a visualizer service that will provide a web interface to visualize how the containers are distributed across the swarm.

This service is built from an image called "visualizer" originally created by Github user ManoMarks. But we'll have to use a version of this image that was built to work on the Raspberry Pi and other ARM devices.

So let's log on to docker1 and create our visualizer service:

ssh pi@docker1 sudo docker service create \ --name viz \ --publish 8080:8080/tcp \ --constraint node.role==manager \ --mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \ alexellis2/visualizer-arm:latest

This will probably take a few minutes to spin up because it has to download the image. We can check the status by typing:

sudo docker service ls

Until the service is ready, you'll see the REPLICAS value as 0/1.

lqejzqrv0le8 viz replicated 0/1 alexellis2/visualizer-arm:latest

It will say 1/1 when it's ready.

Once it's ready, you can visit http://192.168.1.181:8080 (the IP of docker1 and port 8080). This will show you a nice visualization of the swarm and which containers are running on which nodes.

Of course, for your purpose you'll be creating at least one other service. There is a lot of pertinent information about docker that won't (and can't) be covered in this guide, but check out the official docker documentation for more information and of course check out the Docker interest on howchoo.