Using Docker Engine to Create a Swarm
Before we create our swarm, let's get a quick overview of the docker-machine cli
. Typing docker-machine
on your terminal should give you this output:
Just below that, we have our list of commands:
Note
Remember to always use the help
option when you need to clarify something, that is, docker-machine stop --help
To create our first Docker Swarm cluster, we are going to use docker-machine
to create our manager and worker nodes first.
Before creating the first machine, a quick overview of our objectives gives us the following: we are going to have four docker-machines, one manager, and three workers; they are all running on VirtualBox, thus there are four virtual machines.
Creating Docker Machines
This command is used to create a new virtual Docker host:
docker-machine create --driver <driver> <machine_name>
This means our Docker host will be running on VirtualBox, but managed and controlled by docker-machine
. The --driver
option specifies the...