Docker Config PreProcessor

csgeek profile image csgeek ・1 min read

So, I keep on running into this issue time and time again. I need to dockerize an app, but the application doesn't follow the https://12factor.net/ design or at the very least it's not allowing ENV overrides.

There are tools now that are agnostic to what format the config file is in. (yaml, json, .ini ) and is able to read the configuration in.

https://github.com/spf13/viper is a great example and https://gitlab.com/dashwav/gila is another python example.

How does everyone else deal with updating configs that doesn't support env? I was thinking of writing a tool where my docker image just invokes a pre-processor that is ENV aware.


#!/usr/bin/env bash 
preprocess --config foobar.template foobar.properties


Wouldn't it be worthwhile to create something that adapts the config rather than updating the config by exposing it via volumes or doing weird sed/regex pre-processing?

Any thoughts?


Editor guide