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