Docker Compose Tip #55: docker compose config advanced usage

Most people know docker compose config as “the validate command”. It’s much more than that. The same command can list resources, output JSON, hash services for change detection, and pin image digests for reproducibility. Listing resources Ask Compose what’s actually in your project, after all overrides and interpolation: # List all services docker compose config --services # List all volumes docker compose config --volumes # List all images used docker compose config --images # List all defined profiles docker compose config --profiles These are great in scripts when you need to loop over each service: ...

April 27, 2026 · 2 min · 417 words · Guillaume Lours

Docker Compose Tip #54: Preview changes with --dry-run

Not sure what docker compose up will actually do? Add --dry-run to preview every action without executing anything. Basic usage docker compose up --dry-run Compose shows exactly what it would do: DRY-RUN MODE - Container myapp-db-1 Creating DRY-RUN MODE - Container myapp-db-1 Created DRY-RUN MODE - Container myapp-web-1 Creating DRY-RUN MODE - Container myapp-web-1 Created DRY-RUN MODE - Container myapp-db-1 Starting DRY-RUN MODE - Container myapp-db-1 Started DRY-RUN MODE - Container myapp-web-1 Starting DRY-RUN MODE - Container myapp-web-1 Started Nothing is created, started, or modified. You just see the plan. ...

April 17, 2026 · 2 min · 380 words · Guillaume Lours

Docker Compose Tip #48: Network debugging with docker compose port

When using dynamic port mapping or multiple services, it’s not always obvious which host port maps to which container port. docker compose port tells you exactly. Basic usage # Which host port maps to container port 80 on the web service? docker compose port web 80 # Output: 0.0.0.0:8080 Why dynamic ports matter When you let Docker assign ports automatically, the host port changes on every docker compose up: services: web: image: nginx ports: - "80" # Dynamic host port, container port 80 docker compose port web 80 # Output: 0.0.0.0:55432 (assigned dynamically) This is common in CI or when running multiple instances of the same project. ...

April 3, 2026 · 2 min · 320 words · Guillaume Lours

Docker Compose Tip #34: Debugging with exec vs run

Know the difference between exec and run! Each has its place in your debugging toolkit. The key difference exec: Runs commands in an existing container run: Creates a new container # Exec: enters running container docker compose exec web bash # Run: starts new container docker compose run web bash When to use exec Use exec for debugging running services: # Debug a running web server docker compose exec web bash # Check logs inside container docker compose exec web tail -f /var/log/app.log # Run database queries docker compose exec db psql -U postgres # Check process list docker compose exec web ps aux # Test connectivity from inside docker compose exec web curl http://api:3000/health Important: Container must be running! ...

March 2, 2026 · 3 min · 636 words · Guillaume Lours

Docker Compose Tip #25: Using docker compose events for monitoring

Track everything happening in your Compose stack! Events provide real-time insights into container lifecycle changes. Basic event monitoring Watch events as they happen: # Stream all events docker compose events # JSON format for parsing docker compose events --json # Specific services only docker compose events web worker # Since a specific time docker compose events --since "2026-02-06T10:00:00" Event types Common events you’ll see: container create # Container created container start # Container started container stop # Stop initiated container die # Container exited container destroy # Container removed health_status # Health check changed network connect # Network attached network disconnect # Network detached Processing events Parse with jq: ...

February 6, 2026 · 3 min · 555 words · Guillaume Lours