A feature-level setting changes application behavior between releases or runtime contexts. It belongs alongside release-level and environment-level settings in a configuration model. section 18.1
Apply feature-level settings through layered configuration:
- Package default settings in the container image. section 18.1
- Load environment-specific overrides from a mounted configuration directory. section 18.1
- Override individual features with environment variables. section 18.1
Changing metrics per container
Run the same image with different configuration layers. One container uses packaged defaults with metrics enabled; another mounts development settings that disable metrics; a final override sets APP_METRICS_ENABLED=true. Query each container’s configuration API to verify the result. section 18.1
# switch to the exercise folder: cd ch18/exercises/access-log # run a container with the default config in the image: docker run -d -p 8080:80 diamol/ch18-access-log:2e # run a container loading a local config file override: docker run -d -p 8081:80 ` -v "$(pwd)/config/dev:/app/config-override" ` diamol/ch18-access-log:2e # check the config APIs in each container: curl http:/./localhost:8080/config curl http:/./localhost:8081/config
Run the containers and curl their configuration APIs to observe feature-level overrides directly. section 18.1
