Docker Compose

A Docker tool that starts several related containers together from one YAML file.

In more detail

Instead of typing long docker run commands for a service, its database and a network, you describe them once in compose.yaml and run docker compose up. Compose creates the networks and volumes, starts services in dependency order and lets you tear everything down with docker compose down. It ships with Docker Desktop and as the docker-compose-plugin package on Linux.

Examples

docker compose up -d
docker compose version
docker compose ps --format '{{.Service}} {{.Status}}' lists grafana, loki, otel-collector, prometheus and service.

Related terms

Taught in

References