compose_ps
List containers in a Docker Compose project with filtering by service or state. Returns parsed JSON output for easy integration.
Instructions
List containers in a compose project, parsed from --format json.
args:
project_dir - Dir with the compose file (default: server cwd)
files - Explicit compose file paths (repeatable, -f)
project_name - Compose project name override
services - Restrict output to these services
all - Include stopped containers as well
returns: dict - {"services": list[dict], "raw": }; on non-zero exit
services is an empty list and the caller should inspect raw.stderr.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| all | No | ||
| files | No | ||
| services | No | ||
| project_dir | No | ||
| project_name | No |