From 5345868148713887ff259a775998f702bed0a27e Mon Sep 17 00:00:00 2001 From: Leonard Gram Date: Thu, 30 Jan 2020 20:17:41 +0100 Subject: [PATCH] Docker: change plugin path in custom docker (#21837) This is to make the custom dockerfiles compatible with our instruction to use persitent volumes for the /var/lib/grafana dir. Without this change the contents of that folder will be overshadowed by the persitent volume and none of the pre-installed plugins will be available. --- packaging/docker/custom/Dockerfile | 5 +++++ packaging/docker/custom/ubuntu.Dockerfile | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packaging/docker/custom/Dockerfile b/packaging/docker/custom/Dockerfile index 476b7e28887..8ead865dedb 100644 --- a/packaging/docker/custom/Dockerfile +++ b/packaging/docker/custom/Dockerfile @@ -6,6 +6,11 @@ USER root ARG GF_INSTALL_IMAGE_RENDERER_PLUGIN="false" +ENV GF_PATHS_PLUGINS="/var/lib/grafana-plugins" + +RUN mkdir -p "$GF_PATHS_PLUGINS" && \ + chown -R grafana:grafana "$GF_PATHS_PLUGINS" + RUN if [ $GF_INSTALL_IMAGE_RENDERER_PLUGIN = "true" ]; then \ echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \ echo "http://dl-cdn.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories && \ diff --git a/packaging/docker/custom/ubuntu.Dockerfile b/packaging/docker/custom/ubuntu.Dockerfile index 2aab4d3e3eb..c9d6d1121b2 100644 --- a/packaging/docker/custom/ubuntu.Dockerfile +++ b/packaging/docker/custom/ubuntu.Dockerfile @@ -1,4 +1,4 @@ -ARG GRAFANA_VERSION="latest-ubuntu" +ARG GRAFANA_VERSION="latest" FROM grafana/grafana:${GRAFANA_VERSION}-ubuntu @@ -9,6 +9,11 @@ ARG DEBIAN_FRONTEND=noninteractive ARG GF_INSTALL_IMAGE_RENDERER_PLUGIN="false" +ENV GF_PATHS_PLUGINS="/var/lib/grafana-plugins" + +RUN mkdir -p "$GF_PATHS_PLUGINS" && \ + chown -R grafana:grafana "$GF_PATHS_PLUGINS" + RUN if [ $GF_INSTALL_IMAGE_RENDERER_PLUGIN = "true" ]; then \ apt-get update && \ apt-get upgrade -y && \