☸️Docker Swarm
Also known as Swarm Mode, Docker Swarm Mode, docker swarm init
The tool in Docker that runs containers on many machines. It joins them into one group.
Think of it like
It is like a team captain. The players are there, and the captain tells each one where to stand.
Example
A team of three already runs its app with Docker Compose. They turn on swarm mode on two servers and run three copies of the app with one command.
Why it matters
Definition
Example code
bash
docker swarm init
docker service create --name web --replicas 3 -p 8080:80 nginxCommon mistake
Key takeaways
- 1Built in. Nothing extra to install beyond Docker.
- 2Managers and workers. Managers plan, workers run the containers.
- 3Familiar files. It reads the same compose files.