liveBook · Manning

Configuration api

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

A configuration API is an application endpoint that exposes selected runtime configuration settings to authorized clients.

A configuration API exposes the application’s current runtime settings as JSON. It helps diagnose problems when configuration comes from several layers, but the endpoint itself must be protected. section 18.3

Build the endpoint with three safeguards:

  • Return only selected settings; never expose secrets. section 18.3
  • Restrict access to authorized users. section 18.3
  • Make the feature configurable so it can be enabled or disabled. section 18.3

Inspecting container configuration

Run the container, then request its endpoint with curl: `docker run -d -p 8087:80 diamol/ch18-image-gallery:2e` followed by `curl http://localhost:8087/config`. A second run mounts a development override directory, allowing the response to show merged configuration.

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

How deep it goes
Explains the purpose, risks, and three safeguards, then demonstrates endpoint checks and configuration-file overrides.
Examples
Demonstrates curl requests, TOML defaults, Docker bind mounts, and merged development overrides.
What you can do after
Diagnose configuration problems by querying a protected JSON endpoint and comparing default and overridden runtime settings.
How it connects
Connects configuration management with configuration files, secrets, environment variables, and container deployment.

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.