Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Docker Compose

$ docker-compose Official Med Risk
Docker · Cloud & Infra · Apache-2.0 · macos / linux / windows

Docker Compose (docker-compose / docker compose) orchestrates multi-container stacks from compose.yaml. Compose v2 adds agent-friendly --dry-run, canonical config --format json, structured ps --format json, --progress json, and --ansi never flags.

FCRS-1.0 Score
88 /100
Good
High Confidence
Zero-Friction Install
brew install docker-compose
CLI vs MCP Decision CLI Preferred vs MCP

Direct docker-compose / docker compose execution gives native --dry-run, config --format json, and scoped log tailing without MCP translation.

Agent-Readiness Checklist

Local Probe Evidence
✓ JSON Output
— Field Filtering
✓ Non-Interactive
✓ Dry-Run
— Read-Only Mode
✓ NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md
Version
Docker Compose version v5.6.0
Startup
70 ms
Exit Codes (help / invalid)
0 / 1
NO_COLOR Clean / Non-TTY Safe
Yes / Safe
Captured --help excerpt
Usage:  docker compose [OPTIONS] COMMAND

Define and run multi-container applications with Docker

Options:
      --all-resources              Include all resources, even those not
                                   used by services
      --ansi string                Control when to print ANSI control
                                   characters ("never"|"always"|"auto")
                                   (default "auto")
      --compatibility              Run compose in backward compatibility mode
      --dry-run                    Execute command in dry run mode
      --env-file stringArray       Specify an alternate environment file
  -f, --file stringArray           Compose configuration files
      --parallel int               Control max parallelism, -1 for
                                   unlimited (default -1)
      --profile stringArray        Specify a profile to enable
      --progress string            Set type of progress output (auto,
                                   tty, plain, json, quiet)
      --project-directory string   Specify an alternate working directory
                                   (default: the path of the, first
                                   specified, Compose file)
  -p, --project-name string        Project name

Management Commands:
  bridge                  Convert compose files into another model

Commands:
  attach                  Attach local standard input, output, and error streams to a service's running container
  build                   Build or rebuild services
  commit                  Create a new image from a service container's changes
  config                  Parse, resolve and render compose file in canonical format
  cp                      Copy files/folders between a service container and the local filesystem
  create                  Creates containers for a service
  down                    Stop and remove containers, networks
  events                  Receive real time events from containers
  exec                    Execute a command in a running container
  export                  Export a service container's filesystem as a tar archive
  images                  List images used by the created containers
  kill                    Force stop service containers
  logs                    View output from containers
  ls                      List running compose projects
  pause                   Pause services
  port                    List port mappings or print the public port for a spec

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 23 / 25

Compose v2 natively provides --format json on config and ps, --progress json, --ansi never, and global --dry-run.

  • docker-compose config --format json and ps --format json emit valid JSON
  • --ansi never and --progress json eliminate TTY escape noise
Trust & Safety 21 / 25

Supports --dry-run across lifecycle commands and config validation, though down -v can permanently delete volumes.

  • Global --dry-run flag previews mutations without executing them
  • down -v destroys named data volumes if passed carelessly
Setup & Portability 14 / 15

Single Go binary/plugin on macOS, Linux, and Windows, requiring a running Docker/Colima/OrbStack daemon.

  • Distributed via Homebrew, Docker Desktop, and GitHub Releases
Utility & Efficiency 13 / 15

Standard multi-container local stack runner with scoped service exec, log tailing, and profile support.

  • Handles build, up, ps, logs, and exec for multi-service stacks
Maintenance & Lineage 9 / 10

Official Docker Compose v2 project (docker/compose) under Apache-2.0.

  • Official docker/compose repository
Docs & Verifiability 8 / 10

Extensive official Compose CLI reference and --help output.

  • Official docs at docs.docker.com/reference/cli/docker/compose/

Security, Auth & Guardrails

Auth Modes
No Auth Config File
Credential Storage

Uses local Docker socket (DOCKER_HOST) and registry credentials stored in ~/.docker/config.json.

Side Effects
Read-Only Local Write Destructive
Cost & Quotas

Apache-2.0 open-source CLI; Docker Desktop licensing applies only to Docker Desktop GUI/VM in larger organizations.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# Docker Compose Agent Rules
- Run `docker-compose config --format json` and `docker-compose --dry-run up -d` before starting services.
- Always pass `--ansi never` (and `--tail=100` on `logs`) in non-TTY agent runs.
- Never run `docker-compose down -v` without explicit confirmation, as `-v` deletes named volumes.

Agent-Ready Command Recipes

Safe Read-Only Queries

Validate and resolve compose.yaml as JSON
docker-compose config --format json

Expands variables, profiles, and overrides into canonical JSON to catch schema errors read-only.

List stack containers in JSON
docker-compose ps --format json

Outputs running and exited service container metadata as structured JSON.

Controlled Writes & Previews

Simulate stack startup with --dry-run
docker-compose --dry-run up -d

Pre-evaluates image pulls, network creation, and container lifecycle steps without changing daemon state.

Strengths for Agents

  • + Global --dry-run previews up, down, and pull steps safely.
  • + Native --format json on config and ps plus --ansi never for clean parsing.
  • + Canonical config resolution catches variable interpolation and YAML mistakes early.

Caveats & Pitfalls

  • ! Requires an active Docker-compatible daemon (DOCKER_HOST) for lifecycle commands.
  • ! docker-compose down -v permanently wipes named volumes.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI