A Docker Swarm stack is a deployable collection of services defined in a Docker Compose-format file. The Swarm manager schedules its services as tasks across worker nodes in a cluster. section 9.1
Use the Swarm vocabulary to understand the deployment:
- A manager node manages the cluster and tells worker nodes what to run. section 9.1
- A task is a running container, while a service defines the task to execute. section 9.1
- A stack groups multiple services under a name and deploys them to the Swarm cluster. section 9.1
Deploy and inspect a stack
From a Swarm manager, run `docker stack deploy -c compose-swarm.yaml rk8s`. List deployed stacks with `docker stack ls`, inspect its running tasks with `docker stack ps rk8s`, and remove it with `docker stack rm rk8s`. Visiting any cluster machine’s public IP can show the same application results as Docker Compose, with more service instances. section 9.1.4
To change a deployed stack, edit `compose-swarm.yaml` and run the deployment command again. Swarm updates only the services that changed. section 9.1.4
Figure 9.3 Docker Swarm Stack deployment output
Deployment output provides a visual reference for launching a named stack from a Compose file. section 9.1.4
