Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
openaec-foundation avatar

Docker Errors Compose

  • 9 installs
  • 9 repo stars
  • Updated July 8, 2026
  • openaec-foundation/docker-claude-skill-package

Helps with devops & ci/cd tasks.

About

docker-errors-compose is a Claude Code skill for devops & ci/cd. It helps solo builders move faster with AI-assisted development.

  • docker-errors-compose
  • DevOps & CI/CD
  • AI-coding skill

Docker Errors Compose by the numbers

  • 9 all-time installs (skills.sh)
  • +1 installs in the week ending Aug 4, 2026 (Skillselion tracking)
  • Ranked #1,020 of 1,435 DevOps & CI/CD skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/openaec-foundation/docker-claude-skill-package --skill docker-errors-compose

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs9
repo stars9
Last updatedJuly 8, 2026
Repositoryopenaec-foundation/docker-claude-skill-package

What it does

Helps with devops & ci/cd tasks.

Files

SKILL.mdMarkdownGitHub ↗

docker-errors-compose

Quick Reference

First Response: Validate the Compose File

ALWAYS run docker compose config before debugging any Compose error. This command parses, resolves variables, and renders the final configuration. If it fails, the Compose file itself is broken.

# Validate and render resolved config
docker compose config

# Validate without output (exit code only)
docker compose config -q

# Show resolved environment variables
docker compose config --environment

Critical Warnings

NEVER ignore docker compose config validation errors — they indicate structural problems that ALWAYS cause runtime failures.

NEVER use depends_on without condition: service_healthy when the dependent service needs initialization time (databases, message brokers). The default service_started condition only waits for the container to start, NOT for the application to be ready.

NEVER use the deprecated version: field — it is ignored by Compose v2 and generates warnings.

ALWAYS use named volumes for persistent data. Anonymous volumes are lost on docker compose down.

ALWAYS quote port mappings that start with numbers below 60 to prevent YAML parsing as sexagesimal (base-60) numbers.

---

Diagnostic Decision Tree

Compose File Won't Parse

docker compose config fails
├── YAML syntax error?
│   ├── Check indentation (spaces only, NEVER tabs)
│   ├── Check colons have space after them in mappings
│   └── Check strings with special chars are quoted
├── "services" missing?
│   └── The `services` key is REQUIRED — add it
├── Unknown attribute error?
│   ├── Check spelling of Compose directives
│   └── Check indentation level (attribute under wrong parent)
└── Variable interpolation error?
    ├── Unset variable? → Use ${VAR:-default} or set in .env
    ├── Dollar sign in value? → Escape with $$ (e.g., $$HOME)
    └── Single-quoted in .env? → Values are literal, no interpolation

Services Won't Start

docker compose up fails
├── Port conflict?
│   ├── "port is already allocated" → Find process: lsof -i :PORT
│   └── Two services using same host port → Change one
├── Dependency failure?
│   ├── "dependency failed to start" → Check dependent service logs
│   ├── Healthcheck timeout → Increase interval/retries/start_period
│   └── service_completed_successfully never exits 0 → Fix init service
├── Build failure?
│   ├── "build path ... does not exist" → Check context path
│   ├── Dockerfile not found → Check dockerfile path relative to context
│   └── Build context too large → Add .dockerignore
├── Image not found?
│   ├── "pull access denied" → docker login or check image name
│   └── "manifest unknown" → Verify tag exists in registry
├── Volume mount error?
│   ├── "permission denied" → Match UID/GID or fix ownership
│   ├── Named volume not declared → Add to top-level volumes:
│   └── External volume missing → Create it first
└── Environment variable error?
    ├── "variable is not set" → Define in .env or environment
    └── Wrong value resolved → Check precedence order

Orphan Container Warnings

"Found orphan containers"
├── Service removed from compose.yaml → docker compose down --remove-orphans
├── Project name changed → Use consistent -p flag or COMPOSE_PROJECT_NAME
└── Suppress warning → Set COMPOSE_IGNORE_ORPHANS=true

---

Error Diagnostic Table

Error MessageCauseFix
yaml: line N: did not find expected keyYAML indentation or syntax errorCheck line N for tabs (use spaces), missing colons, or unquoted special characters
services is requiredMissing services: top-level keyAdd services: as the top-level element
service "X" refers to undefined network "Y"Network used but not declaredAdd network Y to top-level networks: section
service "X" refers to undefined volume "Y"Named volume used but not declaredAdd volume Y to top-level volumes: section
port is already allocatedHost port in use by another container or processFind occupant: lsof -i :PORT or `ss -tlnp \
Bind for 0.0.0.0:PORT failedSame as above — port conflictSame fix as above
dependency "X" is not a valid servicedepends_on references nonexistent serviceCheck service name spelling in depends_on
Found orphan containersServices removed or project name changedRun docker compose down --remove-orphans
variable "X" is not setInterpolation variable undefinedDefine in .env file, or use ${X:-default} syntax
invalid interpolation formatMalformed variable syntaxCheck for unescaped $. Use $$ for literal dollar sign
build path /path does not existBuild context directory missingVerify context: path exists relative to compose.yaml
Cannot locate specified DockerfileDockerfile path wrongCheck dockerfile: is relative to context:, not compose.yaml
pull access denied for XImage not found or authentication requiredRun docker login. Verify image name and tag
no matching manifest for linux/amd64Image not available for platformAdd platform: to service or use compatible image
service "X" has neither an image nor a build contextService needs image or buildAdd image: or build: to the service definition
"version" is obsoleteDeprecated version fieldRemove the version: line entirely
invalid service name "X"Service name contains invalid charactersUse only [a-zA-Z0-9._-], start with letter or digit
Compose file not foundNo compose.yaml in directoryCreate compose.yaml or use -f flag to specify path
container name "X" is already in useStale container with same name existsRun docker compose down first, or docker rm X
network X declared as external but could not be foundExternal network does not existCreate it: docker network create X
volume X declared as external but not foundExternal volume does not existCreate it: docker volume create X

---

Common Patterns

Proper Service Dependencies with Healthcheck

services:
  app:
    image: myapp:latest
    depends_on:
      db:
        condition: service_healthy
      redis:
        condition: service_healthy

  db:
    image: postgres:16
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 10s
      timeout: 5s
      retries: 5
      start_period: 30s

  redis:
    image: redis:7-alpine
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 5s
      retries: 3

Safe Port Mapping

ports:
  # ALWAYS quote port mappings to prevent YAML parsing issues
  - "8080:80"
  # Bind to localhost for development
  - "127.0.0.1:5432:5432"

Environment Variable with Required Check

environment:
  DATABASE_URL: ${DATABASE_URL:?DATABASE_URL must be set}
  LOG_LEVEL: ${LOG_LEVEL:-info}

Validation Workflow

# Step 1: Validate syntax and variable resolution
docker compose config -q

# Step 2: Start with build and force recreation
docker compose up --build --force-recreate -d

# Step 3: Check service status
docker compose ps

# Step 4: Check logs for failing services
docker compose logs --tail 50 <service-name>

---

Profile Dependency Resolution

When a profiled service depends on another profiled service, both profiles must be active or the dependency must have no profile:

services:
  app:
    image: myapp

  debug-tools:
    image: debug:latest
    profiles: [debug]
    depends_on:
      - app           # OK: app has no profile, always available

  test-runner:
    image: test:latest
    profiles: [test]
    depends_on:
      - debug-tools   # FAILS unless debug profile is also active

Fix: Either activate both profiles (--profile test --profile debug), remove the cross-profile dependency, or remove the profile from the dependency.

---

Reference Links

  • references/diagnostics.md -- Complete error message to cause to solution mapping
  • references/examples.md -- Common Compose error scenarios with step-by-step fixes
  • references/anti-patterns.md -- Compose configuration mistakes and corrections

Official Sources

  • https://docs.docker.com/compose/compose-file/
  • https://docs.docker.com/compose/compose-file/05-services/
  • https://docs.docker.com/compose/how-tos/environment-variables/variable-interpolation/
  • https://docs.docker.com/compose/how-tos/profiles/
  • https://docs.docker.com/reference/cli/docker/compose/

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.