docker compose ps Command Reference
List the containers for a compose project.
docker compose ps shows the services in the current project with their state, ports, and health. In CI it confirms the stack is up before running tests and surfaces which service crashed when something went wrong.
Common flags
-a, --all- include stopped service containers-q, --quiet- output only container IDs--format- output style, e.g. json for scripting--status- filter by status, e.g. running or exited--services- list service names only
Example
shell
docker compose ps --format json
docker compose ps --status exited --servicesIn CI
Use docker compose ps --format json and parse it to assert every expected service is running and healthy before integration tests. --status exited quickly identifies a service that crashed during startup so the job can fail fast with a clear cause.
Key takeaways
- --format json makes the service state machine-parseable for assertions.
- --status exited surfaces a crashed service immediately.
- Use it as a readiness check before running integration tests.
Related guides
docker compose up Command ReferenceReference for docker compose up in CI: start services from a compose file with -d, --build, and --wait so dep…
docker compose logs Command ReferenceReference for docker compose logs in CI: view aggregated service logs with --tail, --no-color, and --timestam…
docker ps Command ReferenceReference for docker ps in CI: list running or all containers with -a, -q, --filter, and --format to inspect…