This scenario introduces Docker Swarm. Swarm makes it easy to manage a cluster of Docker hosts.
The environment has been configured with two clients and two docker hosts. The docker can be access from the client using the hostname docker.
Docker Swarm is deployed via a container on each of the hosts.
Create a Swarm Cluster
To create a group of hosts for Swarm to manage you first need to create a cluster identified by a SwarmID.
Swarm is deployed via a Docker container and the token is created using
All Docker hosts will use this token to join to the same cluster. As we'll be using this token in future commands we'll store the result in a variable called $SWARMID.
Execute the command below to create and store the token which will then be displayed on the screen.
SWARMID=$(docker run --rm -ti swarm create); echo $SWARMID