Reputation: 10588
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:
sed -i s/ENVVAR/${ENVVAR}/g config.json
: it works but it's a bit too "raw" for my taste.Upvotes: 4
Views: 2738
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