docker compose config Command Reference
Validate and render the resolved compose configuration.
docker compose config parses, merges, and interpolates the compose files plus environment, then prints the fully resolved configuration. In CI it is a fast validation gate: a malformed file or undefined variable fails here before any container starts.
Common flags
-q, --quiet- validate only, print nothing (exit code signals validity)--services- list the service names--volumes- list the volume names--no-interpolate- do not substitute environment variables--format- output format, e.g. json or yaml
Example
shell
docker compose config -q
docker compose config --servicesIn CI
Add docker compose config -q as a lint step early in the pipeline so syntax errors and unset required variables fail fast with a clear message, instead of surfacing as a confusing failure during compose up. The non-zero exit code makes it a clean gate.
Key takeaways
- config -q is a fast fail-fast validation gate for compose files.
- It surfaces unset required variables before any container starts.
- --services and --volumes enumerate names for downstream scripting.
Related guides
docker compose up Command ReferenceReference for docker compose up in CI: start services from a compose file with -d, --build, and --wait so dep…
docker compose build Command ReferenceReference for docker compose build in CI: build service images defined in a compose file with --no-cache, --p…
docker compose ps Command ReferenceReference for docker compose ps in CI: list the status of project services with -a, --format, and --status to…