liveBook · Manning

Config command

As explained in Learn Docker in a Month of Lunches, Second Edition

The Docker Compose config command validates Compose configuration files and outputs their merged configuration without deploying the application.

The Docker Compose config command validates Compose files and prints the final configuration without deploying the application. It is a practical dry run for checking overrides and YAML processing. section 10.2 section 10.4

Use config to:

  • Inspect how multiple Compose files merge. section 10.2
  • Confirm that files are valid before deployment. section 10.2
  • Verify YAML extension fields after they are merged into service definitions. section 10.4
  • Check override precedence: files listed on the right override files listed on the left. section 10.2

Preview an override

Run docker compose -f ./todo-list/docker-compose.yml -f ./todo-list/docker-compose-v2.yml config. The output contains the complete merged Compose file, including the overridden image tag. Output is alphabetically ordered, with networks before services. section 10.2

# browse to the image-gallery folder under ch10/exercises:
cd ../image-gallery
# check config for the production override:
docker compose `
 -f ./docker-compose.yml `
 -f ./docker-compose-prod.yml `
 config

Run config against a production override to inspect the resulting configuration without starting the image-gallery application. section 10.4

How Learn Docker in a Month of Lunches, Second Edition covers it

How deep it goes
Explains validation, merging, precedence, output ordering, and extension processing, but stops short of deployment.
Examples
Uses image-tag overrides, production overrides, and service definitions that merge logging settings and labels.
What it assumes
Assumes familiarity with Compose files and services while demonstrating override structure and YAML extension merging.
What you can do after
Evaluate merged Compose configurations and diagnose ordering or validation problems before deploying applications.
How it connects
Connects Docker Compose override files, YAML merge syntax, extension fields, and deployment automation.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn Docker in a Month of Lunches, Second Edition. The section links point to the parts of the book it draws on.