Configure a Grafana Docker image

    If you do not designate a location for information storage, then all your Grafana data disappears as soon as you stop your container. To save your data, you need to set up persistent storage or bind mounts for your container.

    Run Grafana container using bind mounts

    You may want to run Grafana in Docker but use folders on your host for the database or configuration. When doing so, it becomes important to start the container with a user that is able to access and write to the folder you map into the container.

    Logs in the Docker container go to standard out by default, as is common in the Docker world. Change this by setting a different .

    Example:

    Only available in Grafana v5.2 and later.

    You can do this with any of the configuration options in conf/grafana.ini by setting to the path of the file holding the secret.

    For example, you could set the admin password this way:

    • Environment variable: GF_SECURITY_ADMIN_PASSWORD__FILE=/run/secrets/admin_password

    You may also specify multiple profiles to (e.g. GF_AWS_PROFILES=default another).

    • GF_AWS_${profile}_ACCESS_KEY_ID: AWS access key ID (required).
    • : AWS secret access key (required).