@@ -2,13 +2,20 @@ command: docker compose ps
2
2
short : List containers
3
3
long : |-
4
4
Lists containers for a Compose project, with current status and exposed ports.
5
- By default, both running and stopped containers are shown:
6
5
7
6
```console
8
7
$ 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)
12
19
```
13
20
usage : docker compose ps [OPTIONS] [SERVICE...]
14
21
pname : docker compose
@@ -139,12 +146,12 @@ examples: |-
139
146
140
147
```console
141
148
$ 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
144
151
145
152
$ 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)
148
155
```
149
156
150
157
### Filter containers by status (--filter) {#filter}
@@ -155,12 +162,8 @@ examples: |-
155
162
156
163
```console
157
164
$ 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
164
167
```
165
168
166
169
The `docker compose ps` command currently only supports the `--filter status=<status>`
0 commit comments