Creating a Docker Swarm
Creating a Docker Swarm is almost trivial. It is so easy that if you know how orchestrators work, it might even seem unbelievable. But it is true, Docker has done a fantastic job in making Swarms simple and elegant to use. At the same time, Docker Swarm has been proven to be very robust and scalable when used by large enterprises.
Creating a local single-node swarm
So, enough imagining—let’s demonstrate how we can create a Swarm. In its most simple form, a fully functioning Docker Swarm consists only of a single node. If you’re using Docker Desktop, or even if you’re using Docker Toolbox, then your personal computer or laptop is such a node. Hence, we can start right there and demonstrate some of the most important features of a Swarm.
Let’s initialize a Swarm. On the command line, just enter the following command:
$ docker swarm init
After an incredibly short time, you should see an output like the following...