How do I use grafana-cli on a docker installed by Grafana?

I have installed grafana via docker .

Can grafana-cli be exported and run on my host?

+3


source to share


2 answers


If you meant running Grafana with plugins installed, you can do so by passing a list of plugin names to a variable named GF_INSTALL_PLUGINS .

sudo docker run -d -p 3000:3000 -e "GF_INSTALL_PLUGINS=gridprotectionalliance-openhistorian-datasource,gridprotectionalliance-osisoftpi-datasource" grafana/grafana

      



I did it on Grafana 4.x

Installing plugins for Grafana 3 "or higher"

+4


source


For fully automatic configuration of your Grafana program with the plugins you want, I would follow Ricardo's suggestion . It is much better if you can configure your entire container as you would like in one stroke.

However, if you're just playing around with plugins and want to install some of them manually, you can access the shell on a working docker instance from the host.

host:~$ docker exec -it grafana /bin/bash

... if you named your docker container "grafana", otherwise you will need to replace the given container name. The shell prompt that returns will allow you to run the standard



root@3e04b4578ebe:/# grafana-cli plugins install ....

Be warned that he may tell you to start service grafana-server restart

after that. In my experience that didn't work (not sure if it works like a traditional service in a container). However, if you exit the container and restart the container from the host ...

host:~$ docker restart grafana

This should restart the grafana service and your new plugins should be in place.

+1


source







All Articles