When to use docker compose
Use docker compose to manage a defined multi-container project. Confirm the Compose file, environment and project context first so that inspection or later changes target the intended application stack.
Syntax
docker compose [PARAMETERS] COMMANDSquare brackets mark optional arguments; an ellipsis means repetition. Replace example file names, user names and server addresses with your own values.
Common options and arguments
Usage examples
Check the syntax and structure of the project
docker compose config --quietThe merged configuration is validated quietly; success normally prints no configuration content.
View project status
docker compose psContainers associated with the selected project are listed.
View service log
docker compose logs --tail 100 webA bounded log tail is requested for the named service.
Notes and limitations
- These examples use the Compose V2 plugin: docker compose, with a space rather than a hyphen.
- up, down and down -v change project state. -v can remove data volumes. config without --quiet can expose substituted secrets.
Common questions and troubleshooting
Why is docker-compose different from docker compose?
The hyphenated command commonly refers to the older standalone interface; the spaced form uses the Docker CLI plugin. Check the installed tool and supported configuration.
Does configuration validation prove the app will run?
No. Valid syntax and configuration do not verify image availability, credentials, storage permissions or application health.
Further help
Options vary by version and distribution. Check the installed documentation with this command: docker compose --help.