# Docker volumes and plugins

**URL:** <https://community.grafana.com/t/docker-volumes-and-plugins/8218>\
**Category:** Configuration\
**Tags:** docker\
**Created:** [June 21, 2018, 10:16am UTC](https://community.grafana.com/t/docker-volumes-and-plugins/8218 "2018-06-21T10:16:12Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mauromussin](https://avatars.discourse-cdn.com/v4/letter/m/ecd19e/32.png) [@mauromussin](https://community.grafana.com/u/mauromussin)\
**Post date:** [June 21, 2018, 10:16am UTC](https://community.grafana.com/t/docker-volumes-and-plugins/8218/1 "2018-06-21T10:16:12Z")

</div>

When installing a plugin from Dockerfile it works until I use a volume.  
In this case, the target /var/lib/grafana directory is mapped on a docker source volume: the target overrides the plugin directory and the installed plugin is vanished.  
Anybody else found this issue, and maybe resolved it?

---

<div class="post-metadata">

**Author:** ![jangaraj](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/jangaraj/32/39197_2.png) [@jangaraj](https://community.grafana.com/u/jangaraj)\
**Post date:** [June 21, 2018, 12:21pm UTC](https://community.grafana.com/t/docker-volumes-and-plugins/8218/2 "2018-06-21T12:21:41Z")

</div>

Any example how to replicate your problem will be helpful.

---

<div class="post-metadata">

**Author:** ![mauromussin](https://avatars.discourse-cdn.com/v4/letter/m/ecd19e/32.png) [@mauromussin](https://community.grafana.com/u/mauromussin)\
**Post date:** [June 25, 2018, 10:31am UTC](https://community.grafana.com/t/docker-volumes-and-plugins/8218/3 "2018-06-25T10:31:39Z")

</div>

Consider this simple Dockerfile:

```auto
FROM grafana/grafana
RUN grafana-cli plugins install grafana-worldmap-panel

```

build it (say mygrafana) and run without the option -v

```auto
docker run -d -p 3000:3000 mygrafana

```

You’ll se the plugin is installed. But

```auto
docker run -d -p 3000:3000 -v <whatever>:/var/lib/grafana mygrafana

```

no plugin installed

---

<div class="post-metadata">

**Author:** ![jangaraj](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/jangaraj/32/39197_2.png) [@jangaraj](https://community.grafana.com/u/jangaraj)\
**Post date:** [June 25, 2018, 11:41am UTC](https://community.grafana.com/t/docker-volumes-and-plugins/8218/4 "2018-06-25T11:41:01Z")

</div>

That makes sense. Plugin is installed in the Docker image folder `/var/lib/grafana`, but you are overwriting it in the container with your host folder, where plugin is not installed.

What is your use case, when you need to add plugin into image?  
Why you can’t install plugin into container (container!=image), by using env variable `GF_INSTALL_PLUGINS` - [http://docs.grafana.org/installation/docker/](http://docs.grafana.org/installation/docker/)

---

<div class="post-metadata">

**Author:** ![mauromussin](https://avatars.discourse-cdn.com/v4/letter/m/ecd19e/32.png) [@mauromussin](https://community.grafana.com/u/mauromussin)\
**Post date:** [June 25, 2018, 12:03pm UTC](https://community.grafana.com/t/docker-volumes-and-plugins/8218/5 "2018-06-25T12:03:45Z")

</div>

I do not use the ENV variable because I’m behind a proxy with a huge filter on https, so I tried to build an image directly from dockerhub.

---

<div class="post-metadata">

**Author:** ![jangaraj](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/jangaraj/32/39197_2.png) [@jangaraj](https://community.grafana.com/u/jangaraj)\
**Post date:** [June 25, 2018, 12:57pm UTC](https://community.grafana.com/t/docker-volumes-and-plugins/8218/6 "2018-06-25T12:57:24Z")

</div>

Hah, ordinary secure enterprise environment :-). Don’t install plugin into default `/var/lib/grafana`, but use different path - env variable `GF_PLUGIN_DIR`.

Example of Dockerfile, which installs plugins into `/grafana-plugins` directory: [https://github.com/monitoringartist/grafana-xxl/blob/master/Dockerfile#L15](https://github.com/monitoringartist/grafana-xxl/blob/master/Dockerfile#L15)

---

<div class="post-metadata">

**Author:** ![mauromussin](https://avatars.discourse-cdn.com/v4/letter/m/ecd19e/32.png) [@mauromussin](https://community.grafana.com/u/mauromussin)\
**Post date:** [June 25, 2018, 12:59pm UTC](https://community.grafana.com/t/docker-volumes-and-plugins/8218/7 "2018-06-25T12:59:18Z")

</div>

Nice hint!  
I will try it soon.

---

<div class="post-metadata">

**Author:** ![mauromussin](https://avatars.discourse-cdn.com/v4/letter/m/ecd19e/32.png) [@mauromussin](https://community.grafana.com/u/mauromussin)\
**Post date:** [September 10, 2018, 4:04pm UTC](https://community.grafana.com/t/docker-volumes-and-plugins/8218/8 "2018-09-10T16:04:19Z")

</div>

Hi Jan,

I’m trying to install a plugin on a docker container (i.e. grafana-worldmap-panel) but I’m having some trouble because I’m behind a corporate firewall and I cannot connect to [https://grafana.com/api/plugins/repo](https://grafana.com/api/plugins/repo) . So the optimal way to do it (GF\_PLUGINS\_INSTALL) does not work.

I’ve tried with instructions found on grafana’s git repo but:

---

<div class="post-metadata">

**Author:** ![jangaraj](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/jangaraj/32/39197_2.png) [@jangaraj](https://community.grafana.com/u/jangaraj)\
**Post date:** [September 10, 2018, 4:45pm UTC](https://community.grafana.com/t/docker-volumes-and-plugins/8218/9 "2018-09-10T16:45:45Z")

</div>

I know: corporate firewall + very strict security department. You may use your corporate http(s) proxy (if it is available) with env. variables `http_proxy,https_proxy` or some Docker image, where plugin will be preinstalled - for example, my full-fat XXL image - [https://github.com/monitoringartist/grafana-xxl/](https://github.com/monitoringartist/grafana-xxl/)

---

<div class="post-metadata">

**Author:** ![mauromussin](https://avatars.discourse-cdn.com/v4/letter/m/ecd19e/32.png) [@mauromussin](https://community.grafana.com/u/mauromussin)\
**Post date:** [September 10, 2018, 7:07pm UTC](https://community.grafana.com/t/docker-volumes-and-plugins/8218/10 "2018-09-10T19:07:06Z")

</div>

My corporate firewall does not allow connections on 443 for unknown sites (as grafana is)

Ottieni [Outlook per Android](https://aka.ms/ghei36)
