Skip to content

Commit 4721c01

Browse files
ndeloofglours
authored andcommitted
fix docs to reflect docker compose ps being aligned with docker ps
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent 5919fcb commit 4721c01

File tree

2 files changed

+34
-28
lines changed

2 files changed

+34
-28
lines changed

docs/reference/compose_ps.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,20 @@ List containers
2020
## Description
2121

2222
Lists containers for a Compose project, with current status and exposed ports.
23-
By default, both running and stopped containers are shown:
2423

2524
```console
2625
$ docker compose ps
27-
NAME COMMAND SERVICE STATUS PORTS
28-
example-bar-1 "/docker-entrypoint.…" bar exited (0)
29-
example-foo-1 "/docker-entrypoint.…" foo running 0.0.0.0:8080->80/tcp
26+
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
27+
example-foo-1 alpine "/entrypoint.…" foo 4 seconds ago Up 2 seconds 0.0.0.0:8080->80/tcp
28+
```
29+
30+
By default, only running containers are shown. `--all` flag can be used to include stopped containers
31+
32+
```console
33+
$ docker compose ps --all
34+
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
35+
example-foo-1 alpine "/entrypoint.…" foo 4 seconds ago Up 2 seconds 0.0.0.0:8080->80/tcp
36+
example-bar-1 alpine "/entrypoint.…" bar 4 seconds ago exited (0)
3037
```
3138

3239
## Examples
@@ -89,12 +96,12 @@ to show only containers that are running or only containers that have exited:
8996

9097
```console
9198
$ docker compose ps --status=running
92-
NAME COMMAND SERVICE STATUS PORTS
93-
example-foo-1 "/docker-entrypoint.…" foo running 0.0.0.0:8080->80/tcp
99+
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
100+
example-foo-1 alpine "/entrypoint.…" foo 4 seconds ago Up 2 seconds 0.0.0.0:8080->80/tcp
94101

95102
$ docker compose ps --status=exited
96-
NAME COMMAND SERVICE STATUS PORTS
97-
example-bar-1 "/docker-entrypoint.…" bar exited (0)
103+
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
104+
example-bar-1 alpine "/entrypoint.…" bar 4 seconds ago exited (0)
98105
```
99106

100107
### <a name="filter"></a> Filter containers by status (--filter)
@@ -105,12 +112,8 @@ this time using the `--filter` flag:
105112

106113
```console
107114
$ docker compose ps --filter status=running
108-
NAME COMMAND SERVICE STATUS PORTS
109-
example-foo-1 "/docker-entrypoint.…" foo running 0.0.0.0:8080->80/tcp
110-
111-
$ docker compose ps --filter status=running
112-
NAME COMMAND SERVICE STATUS PORTS
113-
example-bar-1 "/docker-entrypoint.…" bar exited (0)
115+
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
116+
example-foo-1 alpine "/entrypoint.…" foo 4 seconds ago Up 2 seconds 0.0.0.0:8080->80/tcp
114117
```
115118

116119
The `docker compose ps` command currently only supports the `--filter status=<status>`

docs/reference/docker_compose_ps.yaml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,20 @@ command: docker compose ps
22
short: List containers
33
long: |-
44
Lists containers for a Compose project, with current status and exposed ports.
5-
By default, both running and stopped containers are shown:
65
76
```console
87
$ docker compose ps
9-
NAME COMMAND SERVICE STATUS PORTS
10-
example-bar-1 "/docker-entrypoint.…" bar exited (0)
11-
example-foo-1 "/docker-entrypoint.…" foo running 0.0.0.0:8080->80/tcp
8+
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
9+
example-foo-1 alpine "/entrypoint.…" foo 4 seconds ago Up 2 seconds 0.0.0.0:8080->80/tcp
10+
```
11+
12+
By default, only running containers are shown. `--all` flag can be used to include stopped containers
13+
14+
```console
15+
$ docker compose ps --all
16+
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
17+
example-foo-1 alpine "/entrypoint.…" foo 4 seconds ago Up 2 seconds 0.0.0.0:8080->80/tcp
18+
example-bar-1 alpine "/entrypoint.…" bar 4 seconds ago exited (0)
1219
```
1320
usage: docker compose ps [OPTIONS] [SERVICE...]
1421
pname: docker compose
@@ -139,12 +146,12 @@ examples: |-
139146
140147
```console
141148
$ docker compose ps --status=running
142-
NAME COMMAND SERVICE STATUS PORTS
143-
example-foo-1 "/docker-entrypoint.…" foo running 0.0.0.0:8080->80/tcp
149+
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
150+
example-foo-1 alpine "/entrypoint.…" foo 4 seconds ago Up 2 seconds 0.0.0.0:8080->80/tcp
144151
145152
$ docker compose ps --status=exited
146-
NAME COMMAND SERVICE STATUS PORTS
147-
example-bar-1 "/docker-entrypoint.…" bar exited (0)
153+
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
154+
example-bar-1 alpine "/entrypoint.…" bar 4 seconds ago exited (0)
148155
```
149156
150157
### Filter containers by status (--filter) {#filter}
@@ -155,12 +162,8 @@ examples: |-
155162
156163
```console
157164
$ docker compose ps --filter status=running
158-
NAME COMMAND SERVICE STATUS PORTS
159-
example-foo-1 "/docker-entrypoint.…" foo running 0.0.0.0:8080->80/tcp
160-
161-
$ docker compose ps --filter status=running
162-
NAME COMMAND SERVICE STATUS PORTS
163-
example-bar-1 "/docker-entrypoint.…" bar exited (0)
165+
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
166+
example-foo-1 alpine "/entrypoint.…" foo 4 seconds ago Up 2 seconds 0.0.0.0:8080->80/tcp
164167
```
165168
166169
The `docker compose ps` command currently only supports the `--filter status=<status>`

0 commit comments

Comments
 (0)