A Docker image for running confd, based on Alpine Linux. This image belongs to a suite of images documented here.
This image features:
3.1.0
,latest
(Dockerfile)3.0.0
(Dockerfile)2.0.0
(Dockerfile)1.0.2
(Dockerfile)1.0.1
(Dockerfile)1.0.0
(Dockerfile)
See VERSIONS.md for image contents.
To use this image include FROM smebberson/alpine-confd
at the top of your Dockerfile
, or simply docker run --name confd smebberson/alpine-confd
.
By default, this container doesn't actually do anything other than provide the building blocks for a Docker container that includes configuration management via confd.
A good pattern to running confd is to take advantage of container initialization hooks, and run confd before any service starts, creating the necessary configuration files.
#!/usr/bin/with-contenv sh
# Setup the templates.
confd -onetime -backend env
Add your template resource config files in /etc/confd/conf.d/
. For example:
# /etc/confd/conf.d/test.toml
[template]
src = "test.conf.tmpl"
dest = "/tmp/test.conf"
Add your source templates in /etc/confd/templates
. For example:
# this is a test only
test_variable = "{{getenv "test_variable"}}"
An example of using this image can be found in examples/user-confd.