Building the Grafana Docker Image

git clone https://github.com/grafana/grafana.git`

Create The Image With Plugins

By default, we require our Grafana images to have pre-installed plugins, in particular these should include at least the following

  • The Natel Power discrete data panel

  • The Grafana image renderer

To ensure that they are always present we make them part of the base build of the container image that we will deploy onto our EKS infrastructure. This involves passing the names of the plugins to the build process when creating the container image. Two environment variables are used for this purpose

  • GF_INSTALL_PLUGINS takes a list of web installable plugin names and pre-applies this to the created image

  • GF_INSTALL_IMAGE_RENDERER is a boolean variable that if set will install the image renderer. This plugin is treated specially as it has a number of lower level dependencies that need to be installed to the base.

cd grafana/packaging/docker/custom

docker build \
--build-arg "GRAFANA_VERSION=latest" \
--build-arg "GF_INSTALL_PLUGINS=natel-discrete-panel" \
--build-arg "GF_INSTALL_IMAGE_RENDERER_PLUGIN=true" \
-t grafana-custom -f Dockerfile .``

This will create a local docker image file with the tag grafana-custom

Run The Docker Image

…​ docker run -d -p 3000:3000 --name=grafana grafana-custom …​

Configuration