Configuration in Docker
Much of the software that software developers create now runs in containers, as opposed to traditional, full operating system environments. This dramatically simplifies how software expects to be configured.
In a container environment – whether it’s Docker or another container runtime – you’re dealing with a dramatically smaller environment. There are very few installed programs and utilities, a dramatically stripped-down init
in place of systemd
, and a much smaller filesystem that doesn’t have many of the directories we’ve mentioned here.
The principle of the configuration hierarchy still holds, though. Most containerized applications expect to get their configuration either as
- environment variables, passed in by the container scheduler or the operator launching it,
- a config file somewhere on the container filesystem, often dynamically created by the container scheduler just before the container is started, or
- command...