I read the following article about "How Should I Get Application Configuration into my Docker Containers?" https://dantehranian.wordpress.com/2015/03/25/how-should-i-get-application-configuration-into-my-docker-containers/
It summarizes 4 options for this that were relevant back in 2015. In short:
Baking the Configuration into the Container
Setting the Application Configuration Dynamically via Environment Variables
Setting the Application Configuration Dynamically via Environment Variables (using an external kv store)
Map the Config Files in Directly via Docker Volumes
I'm wondering if nowadays these options are still the only ones viable or are there any new options/patterns to do this?
Thanks.
The preferred method for configuring the Docker Engine on Windows is using a configuration file. The configuration file can be found at 'C:\ProgramData\Docker\config\daemon. json'. You can create this file if it doesn't already exist.
To configure the Docker daemon using a JSON file, create a file at /etc/docker/daemon.json on Linux systems, or C:\ProgramData\docker\config\daemon.json on Windows. On MacOS go to the whale in the taskbar > Preferences > Daemon > Advanced. You can also start the Docker daemon manually and configure it using flags.
Eventhough this article was written in 2015, the configuration options stated for containers are still the same.
On the container level, options 1,2 and 4 are the only available options without using any external services.
For option 3, there are many key stores and services that can be used. But the idea is basically the same: Query a "service" and fetch the configuration during startup or runtime.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With