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.
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.
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.
Most helpful comment
I would like to vote that we replicate the behavior of docker with
docker-compose psnot showing exited or otherwise stopped containers anddocker-compose ps -ashowing all containers running or not