Greetings all, we are building a Grafana-based enterprise analysis tool. The architecture is such that influxDb and Grafana (5.x) run in docker containers, and the containers are configured using compose (i.e. the configuration is controlled using docker-compose.yml).
We need Grafana to send an email when certain parameters become out of range. For certain reasons, grafana.ini, where i would configure [smtp] parameters runs as root, but the user configuring email is not
root. Because of this, I attempted to create a custom.ini, as described here: http://docs.grafana.org/installation/configuration. Based on the article, it looks like defaults.ini and custom.ini should be located in the same directory. My defaults.ini is located in grafana container, /usr/share/grafana/conf directory. I placed my new custom.ini in the same directory, and have a proof that the file is actually being picked up when Grafana container starts (I made changes in the host, which are shown in the container after restart). However, the file is not overriding grafana.ini, and a test of the configured mail channel results in an error that the channel is not configured (in grafana.ini, smtp is not configured). My OS is RHEL 7. Please help!
I was having this same issue, and was able to resolve it by overriding the actual grafana.ini file. For example, here is how I started my docker container (on windows).
docker run -d -p 3000:3000 --name=grafana `
-v C:/DockerData/Grafana:/var/lib/grafana `
-v C:/DockerData/Grafana/custom.ini:/etc/grafana/grafana.ini `
grafana/grafana
Iām sure you have resolved this already, but should someone else run into this, perhaps this gets them going. Also, I believe due to items hardcoded in the container, I could not have the local file be named grafana.ini, that is why it is locally named custom.ini. The container will not start if you try doing the same thing with local file named grafan.ini
1 Like