Updated: Jun 17, 2020
Docker Swarm is a container orchestration tool from Docker and it is Docker’s answer to K8s. It is a set of machines, can be either physical or virtual, configured and joined together to form a cluster thereby enabling the user to manage single or multiple containers deployed across a number machines in the cluster. Docker swarm enables faster deployments and can be scaled up or down on demand.
When deploying multiple containers in a single go, YAML files are used, for example when deploying a LAMP stack where we need to run Apache, MySQL, PHP all in Linux environment this can be achieved by using YAML file then Docker compose deploys the stack.
Working with Docker Swarm
Docker Swarm is achieved by configured and joining a group of machines either physical or virtual. A machine can join in the swarm as either a Manager Node or as a Worker Node. There can be multiple Manager nodes and Worker Nodes in a swarm. The swarm is effective until at least there is one Manager node left running in the swarm. A worker node can be promoted to a Manager node likewise a Manager node can be demoted to Worker node in a swarm. By default, a Manager node functions as both a Manager node as well as a Worker node.