IF I switch off the internet before starting grafana
Starting grafana_grafana_1 ... done
Attaching to grafana_grafana_1
grafana_1 | Failed to send requesterrorGet https://grafana.com/api/plugins/repo/grafana-piechart-panel: dial tcp: lookup grafana.com on 127.0.0.11:53: server misbehaving
grafana_1 | Error: ✗ Failed to send request. error: Get https://grafana.com/api/plugins/repo/grafana-piechart-panel: dial tcp: lookup grafana.com on 127.0.0.11:53: server misbehaving
grafana_1 | NAME:
grafana_1 | Grafana cli plugins install - install <plugin id> <plugin version (optional)>
grafana_1 | USAGE:
grafana_1 | Grafana cli plugins install [arguments...]
grafana_grafana_1 exited with code 1
If the plugin is downloaded once, then why is it downloading them everytime I start the docker-compose
Because it is a part of bootstrap image script, which is executed, when you start container:
What is your problem? You have asked only why plugins are downloaded every time?
I understood the your post and its correct, I was wondering if there is a way to prevent that intelligently, like docker will never download grafana images again and again.
Upon researching I did find a way here using manual changes, but is there a better way?
Use volume (docker volume or directory or volume from another container) for
/pluginfolder in the container and run once Grafana container with:
It will install plugins to persistent storage, so next runs don’t need
GF_INSTALL_PLUGINS variable (only GF_PLUGIN_DIR) and the internet won’t be required + you don’t need to manage own image. You will need
GF_INSTALL_PLUGINS for plugin updates.
You can also build your custom Grafana docker image with your plugins
Just add the command to your Dockerfile
RUN grafana-cli plugins install your_plugin