docs: docker secrets support. (#12141)

Closes #12132
This commit is contained in:
Leonard Gram
2018-06-04 11:49:12 +02:00
committed by GitHub
parent feb5e20779
commit e562ae753b
2 changed files with 13 additions and 0 deletions

View File

@@ -130,6 +130,18 @@ ID=$(id -u) # saves your user id in the ID variable
docker run -d --user $ID --volume "$PWD/data:/var/lib/grafana" -p 3000:3000 grafana/grafana:5.1.0
```
## Reading secrets from files (support for Docker Secrets)
It's possible to supply Grafana with configuration through files. This works well with [Docker Secrets](https://docs.docker.com/engine/swarm/secrets/) as the secrets by default gets mapped into `/run/secrets/<name of secret>` of the container.
You can do this with any of the configuration options in conf/grafana.ini by setting `GF_<SectionName>_<KeyName>_FILE` to the path of the file holding the secret.
Let's say you want to set the admin password this way.
- Admin password secret: `/run/secrets/admin_password`
- Environment variable: `GF_SECURITY_ADMIN_PASSWORD_FILE=/run/secrets/admin_password`
## Migration from a previous version of the docker container to 5.1 or later
The docker container for Grafana has seen a major rewrite for 5.1.