sstarcher / docker-sensu

Dockerized Sensu - Client, Server, Api
MIT License
103 stars 72 forks source link

Files overwritten on mount #58

Closed Rizbe closed 6 years ago

Rizbe commented 7 years ago

When starting the container, if you mount in custom config or even client.json, it's blindly being processed and replaced with the template.

sstarcher commented 7 years ago

If you want to override the configs I would recommend mounting your custom configs over the templates.

absolutejam commented 7 years ago

The problem is, the mount is done prior to running the bin/start so they are always overwritten. I'm currently resorting to building an image layer over yours that removes the process_template() steps but would really appreciate a way to just use config files in a host mount volume instead of them being generated with env vars.

sstarcher commented 7 years ago

My recommendation was to mount /etc/sensu/templates

absolutejam commented 7 years ago

Ah right, my bad!

sstarcher commented 7 years ago

So fully what is happening is all files in https://github.com/sstarcher/docker-sensu/tree/master/templates are processed. If you have a file that overlaps with those files it will get overwritten. If you would like to not use the built in templates you can mount over /etc/sensu/templates

If you want to provide extra templates you can mount and add those to

CONFIG_DIR=/etc/sensu/conf.d
CHECK_DIR=/etc/sensu/check.d
HANDLERS_DIR=/etc/sensu/handlers

Any files in the above directories that end in .tmpl will be processed and added correctly.

All and all the above customization needs documented. It's a more advanced use case.