Docker Compose Commands
Essential CLI commands to control, rebuild, inspect, and teardown multi-container Docker Compose application stacks.
1. Docker Compose CLI Reference
| Command | Description |
|---|---|
docker compose up -d | Builds, creates, and starts all services in detached background mode |
docker compose down | Stops & removes containers, networks created by `up` |
docker compose down -v | Stops containers AND deletes attached named volumes (Full Reset) |
docker compose ps | Lists status of all containers belonging to current Compose stack |
docker compose logs -f | Streams real-time combined logs across all service containers |
docker compose exec <service> bash | Executes interactive shell inside a specific service container |
docker compose build --no-cache | Forces full rebuild of image layers without using cache |
Next Up
Learn Multi-Stage Image Builds: optimizing Dockerfile image sizes down to tiny minimal production sizes.
Next Lesson: Multi-Stage Image Builds →