liveBook · Manning

Hierarchical configuration model

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

A hierarchical configuration model combines settings from multiple sources in a defined precedence order, allowing more specific sources to override defaults.

A hierarchical configuration model combines settings from several sources in a fixed order. Packaged defaults provide a baseline, environment-specific files override them, and environment variables take highest precedence. section 18.3

A containerized application can apply configuration in this order:

  • Load default files from the image's config directory. section 18.3

Inspecting merged configuration

Run the image with its defaults, then repeat with a development configuration bind-mounted at /app/config-override. Query /config after each run to verify the effective settings; add IG_METRICS.ENABLED=TRUE to test an environment-variable override.

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

How deep it goes
Explains file loading, precedence, formats, and verification through a configuration API without descending into library internals.
Examples
Uses Go Viper, TOML defaults, Docker bind mounts, curl requests, and IG_METRICS.ENABLED overrides.
What you can do after
Operate/configure a containerized app by layering files and environment variables, then verify effective settings through its configuration API.
How it connects
Connects configuration files, environment variables, containers, Docker bind mounts, and configuration APIs.

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.