From 0aec401c54ede931a19647378efd2277774e5b37 Mon Sep 17 00:00:00 2001 From: Dean Chen <862469039@qq.com> Date: Wed, 12 Aug 2026 18:11:37 +0500 Subject: [PATCH] docs(stack ps): describe table columns and task vs container ID Clarify that ID is the swarm task ID, what the NAME replica suffix is, and how to find the underlying container ID. Fixes #503 Signed-off-by: Dean Chen <862469039@qq.com> --- docs/reference/commandline/stack_ps.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/reference/commandline/stack_ps.md b/docs/reference/commandline/stack_ps.md index 3026106719c7..6292c69cc84d 100644 --- a/docs/reference/commandline/stack_ps.md +++ b/docs/reference/commandline/stack_ps.md @@ -26,6 +26,21 @@ Lists the tasks that are running as part of the specified stack. > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the > documentation. +### Output columns + +Default table columns: + +| Column | Meaning | +| --- | --- | +| `ID` | Swarm **task** ID (not the container ID). Pass it to `docker inspect` or use `-q` to list task IDs only. The container ID for a running task is under the task's `Status.ContainerStatus.ContainerID` in `docker inspect `. | +| `NAME` | Task name as `_.`. The numeric suffix is the replica slot (for example `voting_redis.2` is replica 2 of the `redis` service in stack `voting`). | +| `IMAGE` | Image the task is running (digest shown with `--no-trunc`). | +| `NODE` | Node name (or node ID with `--no-resolve`) where the task is scheduled. | +| `DESIRED STATE` | State the orchestrator wants for the task (`Running`, `Shutdown`, and so on). | +| `CURRENT STATE` | Actual task state plus how long ago it entered that state. | +| `ERROR` | Failure message when the task did not start or stopped unexpectedly (often truncated unless `--no-trunc`). | +| `PORTS` | Published ports for the task, when applicable. | + ## Examples ### List the tasks that are part of a stack