Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grafana setup on docker - not able to find Config file

Tags:

docker

grafana

I am trying to setup grafana on docker using a custom grafana.ini file, however grafana is not picking up my config, I am using the command below

docker run -d -p 3000:3000 \
-v /opt/pf-grafana:/opt/pf-grafana \
grafana/grafana \
--config=/opt/pf-grafana/grafana.ini

I also verified that the grafana.ini file is correctly formatted. What am I missing?

Grafana.ini entry enter image description here

Grafana logs enter image description here

Contents of /opt/pf-grafana folder (ls from the container) enter image description here

like image 876
Praj Avatar asked Oct 20 '25 19:10

Praj


1 Answers

I finally got it working, the solution was to use environment variables, the "-e" flag overrides the default settings. The AUTH_LDAP_ENABLED and AUTH_LDAP_CONFIG_FILE are the settings in the default grafana.ini file. Note, they need to be specified in CAPS and separated by "_"

Below snippet worked for me

docker run -d -p 3000:3000 -v /opt/pf-grafana:/opt/pf-grafana \
-e "GF_AUTH_LDAP_ENABLED=true" \
-e "GF_AUTH_LDAP_CONFIG_FILE=/opt/pf-grafana/ldap.toml" \
grafana/grafana
like image 158
Praj Avatar answered Oct 23 '25 21:10

Praj



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!