Subprocess wrapper for Docker Compose CLI interaction.
Supports both Docker and Podman compose providers. The compose command is auto-detected in the following order:
CONTAINER_COMPOSE_PROVIDER/PODMAN_COMPOSE_PROVIDERenv varpodman compose(podman 4+ built-in)docker(default fallback)
Summary
Functions
Builds the argument list for docker compose down.
Builds the argument list for docker compose logs.
Builds the argument list for docker compose ps.
Builds the argument list for docker compose pull.
Builds the argument list for docker compose up.
Returns the compose command binary to use.
Runs docker compose down with the given compose configuration.
Runs docker compose logs <service> and returns the output.
Parses the JSON output from docker compose ps.
Parses the Publishers field from a docker compose ps JSON entry
into a list of {container_port, host_port} tuples.
Runs docker compose ps --format=json and parses the output into a list of maps.
Runs docker compose pull with the given compose configuration.
Runs docker compose up -d --wait with the given compose configuration.
Functions
Builds the argument list for docker compose down.
Builds the argument list for docker compose logs.
Builds the argument list for docker compose ps.
Builds the argument list for docker compose pull.
Builds the argument list for docker compose up.
Returns the compose command binary to use.
Auto-detects the available compose provider with the following precedence:
- The
CONTAINER_COMPOSE_PROVIDERorPODMAN_COMPOSE_PROVIDERenvironment variable. podmanif it supports thecomposesubcommand (podman 4+).dockeras the default fallback.
The result is cached after the first call.
Runs docker compose down with the given compose configuration.
Runs docker compose logs <service> and returns the output.
Parses the JSON output from docker compose ps.
Each line is a separate JSON object with fields like Service, ID, State, Publishers.
Parses the Publishers field from a docker compose ps JSON entry
into a list of {container_port, host_port} tuples.
Runs docker compose ps --format=json and parses the output into a list of maps.
Runs docker compose pull with the given compose configuration.
Runs docker compose up -d --wait with the given compose configuration.