From 80903c162e88e21c1fd9645ac38cf4bdee916287 Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Wed, 25 Oct 2017 14:21:32 +0200 Subject: [PATCH] docs: update docker installation docs --- docs/sources/installation/docker.md | 68 ++++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 2 deletions(-) diff --git a/docs/sources/installation/docker.md b/docs/sources/installation/docker.md index bfb754900fa..2b2fb22e9fa 100644 --- a/docs/sources/installation/docker.md +++ b/docs/sources/installation/docker.md @@ -36,11 +36,75 @@ $ docker run -d -p 3000:3000 \ ``` In the above example I map the data folder and sets a configuration option via -an `ENV` instruction. +an `ENV` instruction. + +See the [docker volumes documentation](https://docs.docker.com/engine/admin/volumes/volumes/) if you want to create a volume to use with the Grafana docker image instead of a bind mount (binding to a directory in the host system). ## Configuration -The back-end web server has a number of configuration options. Go the +All options defined in conf/grafana.ini can be overridden using environment +variables by using the syntax `GF__`. +For example: + +```bash +$ docker run \ + -d \ + -p 3000:3000 \ + --name=grafana \ + -e "GF_SERVER_ROOT_URL=http://grafana.server.name" \ + -e "GF_SECURITY_ADMIN_PASSWORD=secret" \ + grafana/grafana +``` + +You can use your own grafana.ini file by using environment variable `GF_PATHS_CONFIG`. + +The back-end web server has a number of configuration options. Go to the [Configuration]({{< relref "configuration.md" >}}) page for details on all those options. +## Installing Plugins for Grafana + +Pass the plugins you want installed to docker with the `GF_INSTALL_PLUGINS` environment variable as a comma separated list. This will pass each plugin name to `grafana-cli plugins install ${plugin}`. + +```bash +docker run \ + -d \ + -p 3000:3000 \ + --name=grafana \ + -e "GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-simple-json-datasource" \ + grafana/grafana +``` + +## Running a Specific Version of Grafana + +```bash +# specify right tag, e.g. 4.5.2 - see Docker Hub for available tags +$ docker run \ + -d \ + -p 3000:3000 \ + --name grafana \ + grafana/grafana:4.5.2 +``` + +## Configuring AWS Credentials for CloudWatch Support + +```bash +$ docker run \ + -d \ + -p 3000:3000 \ + --name=grafana \ + -e "GF_AWS_PROFILES=default" \ + -e "GF_AWS_default_ACCESS_KEY_ID=YOUR_ACCESS_KEY" \ + -e "GF_AWS_default_SECRET_ACCESS_KEY=YOUR_SECRET_KEY" \ + -e "GF_AWS_default_REGION=us-east-1" \ + grafana/grafana +``` + +You may also specify multiple profiles to `GF_AWS_PROFILES` (e.g. +`GF_AWS_PROFILES=default another`). + +Supported variables: + +- `GF_AWS_${profile}_ACCESS_KEY_ID`: AWS access key ID (required). +- `GF_AWS_${profile}_SECRET_ACCESS_KEY`: AWS secret access key (required). +- `GF_AWS_${profile}_REGION`: AWS region (optional).