Docker Config PreProcessor
csgeek

csgeek @csgeek

About: Bonfied geek and Linux enthusiast.

Location:
San Francisco, CA
Joined:
Aug 22, 2020

Docker Config PreProcessor

Publish Date: Aug 27 '20
6 0

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.

like

#!/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?

Comments 0 total

    Add comment