Utility for generating simple config files at container startup.
The json config file holds the required environment variables. Only variables listed there can be used in templates. The templates array defines all templates which shall be generated. fileMode, owner and group are optional.
{
"envvars": [
"MY_TEST_VAR"
],
"templates": [
{
"templatePath": "/tests/test1.tpl",
"destPath": "/tests/dest/mytemplate.txt",
"fileMode": "0700",
"owner": "root",
"group": "root"
},
{
"templatePath": "/tests/test2.tpl",
"destPath": "/tests/dest/mytemplate2.txt",
"fileMode": "0755",
"owner": "10000",
"group": "10000"
}
]
}
Templates are simple go text template files. Environment variables are accessible via the custom .ENV map.
Value of env var MY_TEST_VAR={{ .Env.MY_TEST_VAR }}
$ docker-util -config /path/to/config.json