A Docker Swarm task is a running container scheduled by a manager node on a worker node. Once defined, a task stays on its assigned node. section 9.1
Understand a task through its place in Docker Swarm:
- A manager node schedules tasks; a worker node runs them. section 9.1
- A service defines the task to execute, while a stack groups services from a Docker Compose file. section 9.1
- The docker stack ps command lists the tasks running in a named stack. section 9.1.4
Inspect tasks in a deployed stack
After deploying with docker stack deploy -c compose-swarm.yaml rk8s, run docker stack ps rk8s to see the containers running in the stack. To enter one, run docker exec on the node where its task is running. section 9.1.4
Figure 9.3 Docker Swarm Stack deployment output
View the deployment output associated with a Swarm stack and its running tasks. section 9.1.4
