Compose: Add option to list non-running containers

Created on 4 Mar 2015  路  9Comments  路  Source: docker/compose

Can docker-compose ps have an option like docker-compose ps -a that shows containers which are non-running? Basically, I'd like an easy method to see what's inside the docker-compose.yml file without having to cat the file and skim through it.

arecli exbeginner kinenhancement

Most helpful comment

I would like to vote that we replicate the behavior of docker with
docker-compose ps not showing exited or otherwise stopped containers and
docker-compose ps -a showing all containers running or not

All 9 comments

Hm, so I just realized that ps lists non-running containers if they have exited. I suppose this should be a request to also list services with a "never started" status

It might be good for ps to be more service-centric, yes.

dibs

If "docker-compose ps -a" lists never started containers, wouldn't it be inconsistent with "docker ps -a" semantics?

I would like to vote that we replicate the behavior of docker with
docker-compose ps not showing exited or otherwise stopped containers and
docker-compose ps -a showing all containers running or not

:+1:

I see what @draghuram means: docker-compose ps already lists 'stopped' containers, which is what docker ps -a provides. What we want here is to have a flag to also capture "never started" containers. There is no way to be "consistent" with docker ps here as docker would have no concept of containers that may be started in the future.

I can still see the value in such a mechanism as it will allow to check if any more work needs to be done to start all of the services in an environment. But it does feel a bit off right now in the difference between docker core.

Perhaps another approach would be to add a --dry-run flag to docker-compose up that would detail all of the stuff needed to bring an environment back up?

It seems to be implemented by #6327

Issue grooming: I agree with the previous comment. Closing.

Was this page helpful?
0 / 5 - 0 ratings