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.
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.
Frequently asked questions
docker compose config Command Reference?
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.
In 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.