You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Hamster aba95b8074
5 years ago
.editorconfig Initial commit. 6 years ago
.gitignore Initial commit. 6 years ago Add 5 years ago
main.go Improvements: Add pipe ability. Add default prefix. Generate default output file if input file has .tpl extension. 5 years ago

GoEnValue - a simple templates processor from environment variables.

This tool very useful if you need to configure your containerised software. You can do it by passing environment variables into container on your Docker container start.

How it works

You need to:

  1. create templates from your configuration files
  2. add in your entrypoint script state with execution of goenvalue
  3. build image with your software, templates and goenvalue
  4. run container with environment variables



  memory_limit = {{ .MEMORY_LIMIT }}


  FROM php:7
  COPY php.ini.tpl /etc/php/php.ini.tpl
  COPY /

  goenvalue -p PHP -i /etc/php/php.ini.tpl
  exec $@

Test it:

  $ docker run --rm -it -e PHP_MEMORY_LIMIT=128M my/php:7 php -i | grep memory_limit
  memory_limit => 128M => 128M