Skip to content

utility for generating simple config files at container startup

License

Notifications You must be signed in to change notification settings

ttreuthardt/docker-util

Repository files navigation

Build Status

docker-util

Utility for generating simple config files at container startup.

Config file

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

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 }}

Usage

$ docker-util -config /path/to/config.json

About

utility for generating simple config files at container startup

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages