You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 27, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 27, 2023. It is now read-only.
docker compose ps does not list stopped containers and their exit status #1671
Description
I have found that there are some differences between docker-compose ps and docker-compose ps regarding to stopped containers (when you docker compose stop some-service1):
You can force it using the -a parameter, but I am not sure if there won't be any other containers listed in other scenarios (eg. run command).
Note that also both containers are flagged as unhealthy even though the second one ended gracefully (Exit 0).
$ docker compose ps -a
NAME SERVICE STATUS PORTS
some-service1 some-service1 exited (unhealthy)
some-service2 some-service2 exited (unhealthy)
$ docker compose ps --help
Usage: docker compose ps
List containers
Options:
-a, --all Show all stopped containers (including those created by the run command)
--format string Format the output. Values: [pretty | json]. (default "pretty")
-q, --quiet Only display IDs
--services Display services
Steps to reproduce the issue:
run commands listed above
Describe the results you received:
Different output in newer version
Describe the results you expected:
Same output as in older version
Output of docker version:
I am using docker-for-mac:
Lack of stopped services in compose ps command has been fixed by #1649 (released in "Cloud integration" 1.0.15)
The STATUS column indeed doesn't show the exit status for service, but the health-check status which isn't relevant for exited containers. We should fix this
@ndeloof thanks for such a quick fix :)
One question - will the exit status be listable somehow? If the container stops, I would like to know the reason. The exit status is the first think I would look at.
For example out-of-memory has its own exit status and many other problems too I presume.
It seems the UX is different from docker ps where stopped containers are not listed unless you add the -a argument. I spent quite some time on a bug because I assumed that docker compose ps would not show stopped containers like docker ps.
Maybe we could consider aligning docker ps and docker compose ps 's behavior?
Activity
ndeloof commentedon May 17, 2021
Lack of stopped services in
compose pscommand has been fixed by #1649 (released in "Cloud integration" 1.0.15)The
STATUScolumn indeed doesn't show the exit status for service, but the health-check status which isn't relevant for exited containers. We should fix thispetr-ujezdsky commentedon May 18, 2021
@ndeloof thanks for such a quick fix :)
One question - will the exit status be listable somehow? If the container stops, I would like to know the reason. The exit status is the first think I would look at.
For example out-of-memory has its own exit status and many other problems too I presume.
ndeloof commentedon May 18, 2021
yes,
compose psnow printsexited (code)in STATE column for exited/died containersgabrieldemarmiesse commentedon May 27, 2021
It seems the UX is different from
docker pswhere stopped containers are not listed unless you add the-aargument. I spent quite some time on a bug because I assumed thatdocker compose pswould not show stopped containers likedocker ps.Maybe we could consider aligning
docker psanddocker compose ps's behavior?ndeloof commentedon May 27, 2021
@gabrieldemarmiesse sure, but here we need to embrace docker-compose legacy, which decided to use the
-aflag for another purpose.gabrieldemarmiesse commentedon May 27, 2021
Of course, I understand what you mean