Docker Swarms and Stacks: What's the difference?

Services: Docker Services are the different components of your application...

A service is a an image docker swarm manages for you. You might ask it to run three instances of this image, and docker swarm will do so (if it can).

Docker Hub shows you all the different images you can run.

Cluster: Docker Clusters are when you have a Swarm managing 1+ Services for an application across 2+ Docker Hosts; the Cluster simply refers to all the Docker Hosts where your Service containers are running.

Yeah. A cluster is made up of nodes which are either workers (that run the services), or managers (control the scheduling of services across the nodes). Note that a node can be both a worker and a manager.

I'm still getting my head around managers but I believe you should aim to have an odd number of at least 3 otherwise you can have issues if a manager disappears.

Compose: Docker Compose is a tool used to manage Services, Swarms and Stacks.

Docker compose is used to combine images into a working application. It might include a front end proxy, a website and a backend database for example. This technology has nothing to do with docker swarm particularly... except you can use it to deploy your application across a swarm (https://codefresh.io/blog/deploy-docker-compose-v3-swarm-mode-cluster/)

Stack: Docker Stacks occur when a Swarm Manager is managing multiple...

Stack is used for docker cloud. This probably isn't what you are looking for :)


Docker swarm is a Clustering and orchestration tool. It is used for scheduling containers across multiple nodes. You can combine multiple nodes as a cluster and then send "docker run" command to this cluster.

Docker stack is a collection of services that make up an application in a specific environment. The extension of stack file is yaml (yml also).