Régis B.
Régis B.

Reputation: 10588

Docker dynamic configuration files

Some of my Docker containers require configuration files (think: JSON, YAML or INI files) that depend on environment variables and/or container arguments.

What is the standard approach to automatically generate those environment files?

Solutions I have considered so far include:

  1. Tiller: but I'm not excited by the idea of adding a ruby gem to my containers.
  2. A custom string replacement script written in the same language as my other applications: but I don't want to include an extra script in all my docker projects.
  3. sed -i s/ENVVAR/${ENVVAR}/g config.json: it works but it's a bit too "raw" for my taste.

Upvotes: 4

Views: 2738

Answers (1)

bluescores
bluescores

Reputation: 4677

Check out confd, highly recommend it for this particular use case of "I want templating with minimal clutter in my image". confd allows you to use a local environment variable backend to template out whatever config file format you want.

Upvotes: 2

Related Questions