From 27e147dad877826eccde20470e46dc7128bba776 Mon Sep 17 00:00:00 2001 From: openeuler_bot <673672685@qq.com> Date: Wed, 23 Oct 2024 00:28:52 +0000 Subject: [PATCH 1/5] 24.03-lts update grafana to 11.3.0 --- grafana/11.3.0/24.03-lts/Dockerfile | 31 ++++++++++++ grafana/11.3.0/24.03-lts/entrypoint.sh | 68 ++++++++++++++++++++++++++ grafana/meta.yml | 4 +- 3 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 grafana/11.3.0/24.03-lts/Dockerfile create mode 100644 grafana/11.3.0/24.03-lts/entrypoint.sh diff --git a/grafana/11.3.0/24.03-lts/Dockerfile b/grafana/11.3.0/24.03-lts/Dockerfile new file mode 100644 index 00000000..87212bd8 --- /dev/null +++ b/grafana/11.3.0/24.03-lts/Dockerfile @@ -0,0 +1,31 @@ +ARG BASE=openeuler/openeuler:24.03-lts +FROM ${BASE} + +ARG TARGETARCH +ARG BUILDARCH +ARG VERSION=11.3.0 + +COPY ./entrypoint.sh / +RUN yum -y update && \ + if [ "$TARGETARCH" = "amd64" ]; then \ + BUILDARCH="x86_64"; \ + elif [ "$TARGETARCH" = "arm64" ]; then \ + BUILDARCH="aarch64"; \ + fi && \ + yum install -y https://dl.grafana.com/enterprise/release/grafana-enterprise-${VERSION}-1.${BUILDARCH}.rpm && \ + yum clean all && \ + chmod 755 /entrypoint.sh + + +ENV PATH=/usr/share/grafana/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ + GF_PATHS_CONFIG="/etc/grafana/grafana.ini" \ + GF_PATHS_DATA="/var/lib/grafana" \ + GF_PATHS_HOME="/usr/share/grafana" \ + GF_PATHS_LOGS="/var/log/grafana" \ + GF_PATHS_PLUGINS="/var/lib/grafana/plugins" \ + GF_PATHS_PROVISIONING="/etc/grafana/provisioning" + +EXPOSE 3000 + +USER grafana +ENTRYPOINT [ "/entrypoint.sh" ] diff --git a/grafana/11.3.0/24.03-lts/entrypoint.sh b/grafana/11.3.0/24.03-lts/entrypoint.sh new file mode 100644 index 00000000..3c5ddf7e --- /dev/null +++ b/grafana/11.3.0/24.03-lts/entrypoint.sh @@ -0,0 +1,68 @@ +#!/bin/bash -e + +PERMISSIONS_OK=0 + +if [ ! -r "$GF_PATHS_CONFIG" ]; then + echo "GF_PATHS_CONFIG='$GF_PATHS_CONFIG' is not readable." + PERMISSIONS_OK=1 +fi + +if [ ! -w "$GF_PATHS_DATA" ]; then + echo "GF_PATHS_DATA='$GF_PATHS_DATA' is not writable." + PERMISSIONS_OK=1 +fi + +if [ ! -r "$GF_PATHS_HOME" ]; then + echo "GF_PATHS_HOME='$GF_PATHS_HOME' is not readable." + PERMISSIONS_OK=1 +fi + +if [ $PERMISSIONS_OK -eq 1 ]; then + echo "You may have issues with file permissions, more information here: http://docs.grafana.org/installation/docker/#migrate-to-v51-or-later" +fi + +if [ ! -d "$GF_PATHS_PLUGINS" ]; then + mkdir "$GF_PATHS_PLUGINS" +fi + +# Convert all environment variables with names ending in __FILE into the content of +# the file that they point at and use the name without the trailing __FILE. +# This can be used to carry in Docker secrets. +for VAR_NAME in $(env | grep '^GF_[^=]\+__FILE=.\+' | sed -r "s/([^=]*)__FILE=.*/\1/g"); do + VAR_NAME_FILE="$VAR_NAME"__FILE + if [ "${!VAR_NAME}" ]; then + echo >&2 "ERROR: Both $VAR_NAME and $VAR_NAME_FILE are set (but are exclusive)" + exit 1 + fi + echo "Getting secret $VAR_NAME from ${!VAR_NAME_FILE}" + export "$VAR_NAME"="$(< "${!VAR_NAME_FILE}")" + unset "$VAR_NAME_FILE" +done + +export HOME="$GF_PATHS_HOME" + +if [ ! -z "${GF_INSTALL_PLUGINS}" ]; then + OLDIFS=$IFS + IFS=',' + for plugin in ${GF_INSTALL_PLUGINS}; do + IFS=$OLDIFS + if [[ $plugin =~ .*\;.* ]]; then + pluginUrl=$(echo "$plugin" | cut -d';' -f 1) + pluginInstallFolder=$(echo "$plugin" | cut -d';' -f 2) + grafana-cli --pluginUrl ${pluginUrl} --pluginsDir "${GF_PATHS_PLUGINS}" plugins install "${pluginInstallFolder}" + else + grafana-cli --pluginsDir "${GF_PATHS_PLUGINS}" plugins install ${plugin} + fi + done +fi + +exec grafana-server \ + --homepath="$GF_PATHS_HOME" \ + --config="$GF_PATHS_CONFIG" \ + --packaging=docker \ + "$@" \ + cfg:default.log.mode="console" \ + cfg:default.paths.data="$GF_PATHS_DATA" \ + cfg:default.paths.logs="$GF_PATHS_LOGS" \ + cfg:default.paths.plugins="$GF_PATHS_PLUGINS" \ + cfg:default.paths.provisioning="$GF_PATHS_PROVISIONING" diff --git a/grafana/meta.yml b/grafana/meta.yml index c5850c7d..dab9303c 100644 --- a/grafana/meta.yml +++ b/grafana/meta.yml @@ -7,4 +7,6 @@ 11.2.0-oe2203sp3: path: grafana/11.2.0/22.03-lts-sp3/Dockerfile 11.2.2-oe2203sp3: - path: grafana/11.2.2/22.03-lts-sp3/Dockerfile \ No newline at end of file + path: grafana/11.2.2/22.03-lts-sp3/Dockerfile +11.3.0-oe2403lts: + path: grafana/11.3.0/24.03-lts/Dockerfile \ No newline at end of file -- Gitee From 066be748fa94ba9e6064b06006d5081071321f46 Mon Sep 17 00:00:00 2001 From: openeuler_bot <673672685@qq.com> Date: Wed, 23 Oct 2024 00:29:21 +0000 Subject: [PATCH 2/5] 22.03-lts-sp3 update grafana to 11.3.0 --- grafana/11.3.0/22.03-lts-sp3/Dockerfile | 31 ++++++++++ grafana/11.3.0/22.03-lts-sp3/entrypoint.sh | 68 ++++++++++++++++++++++ grafana/meta.yml | 4 +- 3 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 grafana/11.3.0/22.03-lts-sp3/Dockerfile create mode 100644 grafana/11.3.0/22.03-lts-sp3/entrypoint.sh diff --git a/grafana/11.3.0/22.03-lts-sp3/Dockerfile b/grafana/11.3.0/22.03-lts-sp3/Dockerfile new file mode 100644 index 00000000..00f8b96d --- /dev/null +++ b/grafana/11.3.0/22.03-lts-sp3/Dockerfile @@ -0,0 +1,31 @@ +ARG BASE=openeuler/openeuler:22.03-lts-sp3 +FROM ${BASE} + +ARG TARGETARCH +ARG BUILDARCH +ARG VERSION=11.3.0 + +COPY ./entrypoint.sh / +RUN yum -y update && \ + if [ "$TARGETARCH" = "amd64" ]; then \ + BUILDARCH="x86_64"; \ + elif [ "$TARGETARCH" = "arm64" ]; then \ + BUILDARCH="aarch64"; \ + fi && \ + yum install -y https://dl.grafana.com/enterprise/release/grafana-enterprise-${VERSION}-1.${BUILDARCH}.rpm && \ + yum clean all && \ + chmod 755 /entrypoint.sh + + +ENV PATH=/usr/share/grafana/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ + GF_PATHS_CONFIG="/etc/grafana/grafana.ini" \ + GF_PATHS_DATA="/var/lib/grafana" \ + GF_PATHS_HOME="/usr/share/grafana" \ + GF_PATHS_LOGS="/var/log/grafana" \ + GF_PATHS_PLUGINS="/var/lib/grafana/plugins" \ + GF_PATHS_PROVISIONING="/etc/grafana/provisioning" + +EXPOSE 3000 + +USER grafana +ENTRYPOINT [ "/entrypoint.sh" ] diff --git a/grafana/11.3.0/22.03-lts-sp3/entrypoint.sh b/grafana/11.3.0/22.03-lts-sp3/entrypoint.sh new file mode 100644 index 00000000..3c5ddf7e --- /dev/null +++ b/grafana/11.3.0/22.03-lts-sp3/entrypoint.sh @@ -0,0 +1,68 @@ +#!/bin/bash -e + +PERMISSIONS_OK=0 + +if [ ! -r "$GF_PATHS_CONFIG" ]; then + echo "GF_PATHS_CONFIG='$GF_PATHS_CONFIG' is not readable." + PERMISSIONS_OK=1 +fi + +if [ ! -w "$GF_PATHS_DATA" ]; then + echo "GF_PATHS_DATA='$GF_PATHS_DATA' is not writable." + PERMISSIONS_OK=1 +fi + +if [ ! -r "$GF_PATHS_HOME" ]; then + echo "GF_PATHS_HOME='$GF_PATHS_HOME' is not readable." + PERMISSIONS_OK=1 +fi + +if [ $PERMISSIONS_OK -eq 1 ]; then + echo "You may have issues with file permissions, more information here: http://docs.grafana.org/installation/docker/#migrate-to-v51-or-later" +fi + +if [ ! -d "$GF_PATHS_PLUGINS" ]; then + mkdir "$GF_PATHS_PLUGINS" +fi + +# Convert all environment variables with names ending in __FILE into the content of +# the file that they point at and use the name without the trailing __FILE. +# This can be used to carry in Docker secrets. +for VAR_NAME in $(env | grep '^GF_[^=]\+__FILE=.\+' | sed -r "s/([^=]*)__FILE=.*/\1/g"); do + VAR_NAME_FILE="$VAR_NAME"__FILE + if [ "${!VAR_NAME}" ]; then + echo >&2 "ERROR: Both $VAR_NAME and $VAR_NAME_FILE are set (but are exclusive)" + exit 1 + fi + echo "Getting secret $VAR_NAME from ${!VAR_NAME_FILE}" + export "$VAR_NAME"="$(< "${!VAR_NAME_FILE}")" + unset "$VAR_NAME_FILE" +done + +export HOME="$GF_PATHS_HOME" + +if [ ! -z "${GF_INSTALL_PLUGINS}" ]; then + OLDIFS=$IFS + IFS=',' + for plugin in ${GF_INSTALL_PLUGINS}; do + IFS=$OLDIFS + if [[ $plugin =~ .*\;.* ]]; then + pluginUrl=$(echo "$plugin" | cut -d';' -f 1) + pluginInstallFolder=$(echo "$plugin" | cut -d';' -f 2) + grafana-cli --pluginUrl ${pluginUrl} --pluginsDir "${GF_PATHS_PLUGINS}" plugins install "${pluginInstallFolder}" + else + grafana-cli --pluginsDir "${GF_PATHS_PLUGINS}" plugins install ${plugin} + fi + done +fi + +exec grafana-server \ + --homepath="$GF_PATHS_HOME" \ + --config="$GF_PATHS_CONFIG" \ + --packaging=docker \ + "$@" \ + cfg:default.log.mode="console" \ + cfg:default.paths.data="$GF_PATHS_DATA" \ + cfg:default.paths.logs="$GF_PATHS_LOGS" \ + cfg:default.paths.plugins="$GF_PATHS_PLUGINS" \ + cfg:default.paths.provisioning="$GF_PATHS_PROVISIONING" diff --git a/grafana/meta.yml b/grafana/meta.yml index dab9303c..9b15a125 100644 --- a/grafana/meta.yml +++ b/grafana/meta.yml @@ -9,4 +9,6 @@ 11.2.2-oe2203sp3: path: grafana/11.2.2/22.03-lts-sp3/Dockerfile 11.3.0-oe2403lts: - path: grafana/11.3.0/24.03-lts/Dockerfile \ No newline at end of file + path: grafana/11.3.0/24.03-lts/Dockerfile +11.3.0-oe2203sp3: + path: grafana/11.3.0/22.03-lts-sp3/Dockerfile \ No newline at end of file -- Gitee From c884a7a2b06c3b16cd04fb5fef1304c781f49b26 Mon Sep 17 00:00:00 2001 From: openeuler_bot <673672685@qq.com> Date: Wed, 23 Oct 2024 00:29:51 +0000 Subject: [PATCH 3/5] 22.03-lts-sp4 update grafana to 11.3.0 --- grafana/11.3.0/22.03-lts-sp4/Dockerfile | 31 ++++++++++ grafana/11.3.0/22.03-lts-sp4/entrypoint.sh | 68 ++++++++++++++++++++++ grafana/meta.yml | 4 +- 3 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 grafana/11.3.0/22.03-lts-sp4/Dockerfile create mode 100644 grafana/11.3.0/22.03-lts-sp4/entrypoint.sh diff --git a/grafana/11.3.0/22.03-lts-sp4/Dockerfile b/grafana/11.3.0/22.03-lts-sp4/Dockerfile new file mode 100644 index 00000000..795475bf --- /dev/null +++ b/grafana/11.3.0/22.03-lts-sp4/Dockerfile @@ -0,0 +1,31 @@ +ARG BASE=openeuler/openeuler:22.03-lts-sp4 +FROM ${BASE} + +ARG TARGETARCH +ARG BUILDARCH +ARG VERSION=11.3.0 + +COPY ./entrypoint.sh / +RUN yum -y update && \ + if [ "$TARGETARCH" = "amd64" ]; then \ + BUILDARCH="x86_64"; \ + elif [ "$TARGETARCH" = "arm64" ]; then \ + BUILDARCH="aarch64"; \ + fi && \ + yum install -y https://dl.grafana.com/enterprise/release/grafana-enterprise-${VERSION}-1.${BUILDARCH}.rpm && \ + yum clean all && \ + chmod 755 /entrypoint.sh + + +ENV PATH=/usr/share/grafana/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ + GF_PATHS_CONFIG="/etc/grafana/grafana.ini" \ + GF_PATHS_DATA="/var/lib/grafana" \ + GF_PATHS_HOME="/usr/share/grafana" \ + GF_PATHS_LOGS="/var/log/grafana" \ + GF_PATHS_PLUGINS="/var/lib/grafana/plugins" \ + GF_PATHS_PROVISIONING="/etc/grafana/provisioning" + +EXPOSE 3000 + +USER grafana +ENTRYPOINT [ "/entrypoint.sh" ] diff --git a/grafana/11.3.0/22.03-lts-sp4/entrypoint.sh b/grafana/11.3.0/22.03-lts-sp4/entrypoint.sh new file mode 100644 index 00000000..3c5ddf7e --- /dev/null +++ b/grafana/11.3.0/22.03-lts-sp4/entrypoint.sh @@ -0,0 +1,68 @@ +#!/bin/bash -e + +PERMISSIONS_OK=0 + +if [ ! -r "$GF_PATHS_CONFIG" ]; then + echo "GF_PATHS_CONFIG='$GF_PATHS_CONFIG' is not readable." + PERMISSIONS_OK=1 +fi + +if [ ! -w "$GF_PATHS_DATA" ]; then + echo "GF_PATHS_DATA='$GF_PATHS_DATA' is not writable." + PERMISSIONS_OK=1 +fi + +if [ ! -r "$GF_PATHS_HOME" ]; then + echo "GF_PATHS_HOME='$GF_PATHS_HOME' is not readable." + PERMISSIONS_OK=1 +fi + +if [ $PERMISSIONS_OK -eq 1 ]; then + echo "You may have issues with file permissions, more information here: http://docs.grafana.org/installation/docker/#migrate-to-v51-or-later" +fi + +if [ ! -d "$GF_PATHS_PLUGINS" ]; then + mkdir "$GF_PATHS_PLUGINS" +fi + +# Convert all environment variables with names ending in __FILE into the content of +# the file that they point at and use the name without the trailing __FILE. +# This can be used to carry in Docker secrets. +for VAR_NAME in $(env | grep '^GF_[^=]\+__FILE=.\+' | sed -r "s/([^=]*)__FILE=.*/\1/g"); do + VAR_NAME_FILE="$VAR_NAME"__FILE + if [ "${!VAR_NAME}" ]; then + echo >&2 "ERROR: Both $VAR_NAME and $VAR_NAME_FILE are set (but are exclusive)" + exit 1 + fi + echo "Getting secret $VAR_NAME from ${!VAR_NAME_FILE}" + export "$VAR_NAME"="$(< "${!VAR_NAME_FILE}")" + unset "$VAR_NAME_FILE" +done + +export HOME="$GF_PATHS_HOME" + +if [ ! -z "${GF_INSTALL_PLUGINS}" ]; then + OLDIFS=$IFS + IFS=',' + for plugin in ${GF_INSTALL_PLUGINS}; do + IFS=$OLDIFS + if [[ $plugin =~ .*\;.* ]]; then + pluginUrl=$(echo "$plugin" | cut -d';' -f 1) + pluginInstallFolder=$(echo "$plugin" | cut -d';' -f 2) + grafana-cli --pluginUrl ${pluginUrl} --pluginsDir "${GF_PATHS_PLUGINS}" plugins install "${pluginInstallFolder}" + else + grafana-cli --pluginsDir "${GF_PATHS_PLUGINS}" plugins install ${plugin} + fi + done +fi + +exec grafana-server \ + --homepath="$GF_PATHS_HOME" \ + --config="$GF_PATHS_CONFIG" \ + --packaging=docker \ + "$@" \ + cfg:default.log.mode="console" \ + cfg:default.paths.data="$GF_PATHS_DATA" \ + cfg:default.paths.logs="$GF_PATHS_LOGS" \ + cfg:default.paths.plugins="$GF_PATHS_PLUGINS" \ + cfg:default.paths.provisioning="$GF_PATHS_PROVISIONING" diff --git a/grafana/meta.yml b/grafana/meta.yml index 9b15a125..0cc05f09 100644 --- a/grafana/meta.yml +++ b/grafana/meta.yml @@ -11,4 +11,6 @@ 11.3.0-oe2403lts: path: grafana/11.3.0/24.03-lts/Dockerfile 11.3.0-oe2203sp3: - path: grafana/11.3.0/22.03-lts-sp3/Dockerfile \ No newline at end of file + path: grafana/11.3.0/22.03-lts-sp3/Dockerfile +11.3.0-oe2203sp4: + path: grafana/11.3.0/22.03-lts-sp4/Dockerfile \ No newline at end of file -- Gitee From 1e7395d1e5dee7cceb8a13237315c2cdaed4a5f8 Mon Sep 17 00:00:00 2001 From: openeuler_bot <673672685@qq.com> Date: Wed, 23 Oct 2024 00:30:22 +0000 Subject: [PATCH 4/5] 22.03-lts-sp1 update grafana to 11.3.0 --- grafana/11.3.0/22.03-lts-sp1/Dockerfile | 31 ++++++++++ grafana/11.3.0/22.03-lts-sp1/entrypoint.sh | 68 ++++++++++++++++++++++ grafana/meta.yml | 4 +- 3 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 grafana/11.3.0/22.03-lts-sp1/Dockerfile create mode 100644 grafana/11.3.0/22.03-lts-sp1/entrypoint.sh diff --git a/grafana/11.3.0/22.03-lts-sp1/Dockerfile b/grafana/11.3.0/22.03-lts-sp1/Dockerfile new file mode 100644 index 00000000..8e42d462 --- /dev/null +++ b/grafana/11.3.0/22.03-lts-sp1/Dockerfile @@ -0,0 +1,31 @@ +ARG BASE=openeuler/openeuler:22.03-lts-sp1 +FROM ${BASE} + +ARG TARGETARCH +ARG BUILDARCH +ARG VERSION=11.3.0 + +COPY ./entrypoint.sh / +RUN yum -y update && \ + if [ "$TARGETARCH" = "amd64" ]; then \ + BUILDARCH="x86_64"; \ + elif [ "$TARGETARCH" = "arm64" ]; then \ + BUILDARCH="aarch64"; \ + fi && \ + yum install -y https://dl.grafana.com/enterprise/release/grafana-enterprise-${VERSION}-1.${BUILDARCH}.rpm && \ + yum clean all && \ + chmod 755 /entrypoint.sh + + +ENV PATH=/usr/share/grafana/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ + GF_PATHS_CONFIG="/etc/grafana/grafana.ini" \ + GF_PATHS_DATA="/var/lib/grafana" \ + GF_PATHS_HOME="/usr/share/grafana" \ + GF_PATHS_LOGS="/var/log/grafana" \ + GF_PATHS_PLUGINS="/var/lib/grafana/plugins" \ + GF_PATHS_PROVISIONING="/etc/grafana/provisioning" + +EXPOSE 3000 + +USER grafana +ENTRYPOINT [ "/entrypoint.sh" ] diff --git a/grafana/11.3.0/22.03-lts-sp1/entrypoint.sh b/grafana/11.3.0/22.03-lts-sp1/entrypoint.sh new file mode 100644 index 00000000..3c5ddf7e --- /dev/null +++ b/grafana/11.3.0/22.03-lts-sp1/entrypoint.sh @@ -0,0 +1,68 @@ +#!/bin/bash -e + +PERMISSIONS_OK=0 + +if [ ! -r "$GF_PATHS_CONFIG" ]; then + echo "GF_PATHS_CONFIG='$GF_PATHS_CONFIG' is not readable." + PERMISSIONS_OK=1 +fi + +if [ ! -w "$GF_PATHS_DATA" ]; then + echo "GF_PATHS_DATA='$GF_PATHS_DATA' is not writable." + PERMISSIONS_OK=1 +fi + +if [ ! -r "$GF_PATHS_HOME" ]; then + echo "GF_PATHS_HOME='$GF_PATHS_HOME' is not readable." + PERMISSIONS_OK=1 +fi + +if [ $PERMISSIONS_OK -eq 1 ]; then + echo "You may have issues with file permissions, more information here: http://docs.grafana.org/installation/docker/#migrate-to-v51-or-later" +fi + +if [ ! -d "$GF_PATHS_PLUGINS" ]; then + mkdir "$GF_PATHS_PLUGINS" +fi + +# Convert all environment variables with names ending in __FILE into the content of +# the file that they point at and use the name without the trailing __FILE. +# This can be used to carry in Docker secrets. +for VAR_NAME in $(env | grep '^GF_[^=]\+__FILE=.\+' | sed -r "s/([^=]*)__FILE=.*/\1/g"); do + VAR_NAME_FILE="$VAR_NAME"__FILE + if [ "${!VAR_NAME}" ]; then + echo >&2 "ERROR: Both $VAR_NAME and $VAR_NAME_FILE are set (but are exclusive)" + exit 1 + fi + echo "Getting secret $VAR_NAME from ${!VAR_NAME_FILE}" + export "$VAR_NAME"="$(< "${!VAR_NAME_FILE}")" + unset "$VAR_NAME_FILE" +done + +export HOME="$GF_PATHS_HOME" + +if [ ! -z "${GF_INSTALL_PLUGINS}" ]; then + OLDIFS=$IFS + IFS=',' + for plugin in ${GF_INSTALL_PLUGINS}; do + IFS=$OLDIFS + if [[ $plugin =~ .*\;.* ]]; then + pluginUrl=$(echo "$plugin" | cut -d';' -f 1) + pluginInstallFolder=$(echo "$plugin" | cut -d';' -f 2) + grafana-cli --pluginUrl ${pluginUrl} --pluginsDir "${GF_PATHS_PLUGINS}" plugins install "${pluginInstallFolder}" + else + grafana-cli --pluginsDir "${GF_PATHS_PLUGINS}" plugins install ${plugin} + fi + done +fi + +exec grafana-server \ + --homepath="$GF_PATHS_HOME" \ + --config="$GF_PATHS_CONFIG" \ + --packaging=docker \ + "$@" \ + cfg:default.log.mode="console" \ + cfg:default.paths.data="$GF_PATHS_DATA" \ + cfg:default.paths.logs="$GF_PATHS_LOGS" \ + cfg:default.paths.plugins="$GF_PATHS_PLUGINS" \ + cfg:default.paths.provisioning="$GF_PATHS_PROVISIONING" diff --git a/grafana/meta.yml b/grafana/meta.yml index 0cc05f09..f5b99ff1 100644 --- a/grafana/meta.yml +++ b/grafana/meta.yml @@ -13,4 +13,6 @@ 11.3.0-oe2203sp3: path: grafana/11.3.0/22.03-lts-sp3/Dockerfile 11.3.0-oe2203sp4: - path: grafana/11.3.0/22.03-lts-sp4/Dockerfile \ No newline at end of file + path: grafana/11.3.0/22.03-lts-sp4/Dockerfile +11.3.0-oe2203sp1: + path: grafana/11.3.0/22.03-lts-sp1/Dockerfile \ No newline at end of file -- Gitee From 62e52a28916b75e14c19b66647a745cbc915a3f1 Mon Sep 17 00:00:00 2001 From: openeuler_bot <673672685@qq.com> Date: Wed, 23 Oct 2024 00:30:54 +0000 Subject: [PATCH 5/5] 20.03-lts-sp4 update grafana to 11.3.0 --- grafana/11.3.0/20.03-lts-sp4/Dockerfile | 31 ++++++++++ grafana/11.3.0/20.03-lts-sp4/entrypoint.sh | 68 ++++++++++++++++++++++ grafana/meta.yml | 4 +- 3 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 grafana/11.3.0/20.03-lts-sp4/Dockerfile create mode 100644 grafana/11.3.0/20.03-lts-sp4/entrypoint.sh diff --git a/grafana/11.3.0/20.03-lts-sp4/Dockerfile b/grafana/11.3.0/20.03-lts-sp4/Dockerfile new file mode 100644 index 00000000..5ff5b6aa --- /dev/null +++ b/grafana/11.3.0/20.03-lts-sp4/Dockerfile @@ -0,0 +1,31 @@ +ARG BASE=openeuler/openeuler:20.03-lts-sp4 +FROM ${BASE} + +ARG TARGETARCH +ARG BUILDARCH +ARG VERSION=11.3.0 + +COPY ./entrypoint.sh / +RUN yum -y update && \ + if [ "$TARGETARCH" = "amd64" ]; then \ + BUILDARCH="x86_64"; \ + elif [ "$TARGETARCH" = "arm64" ]; then \ + BUILDARCH="aarch64"; \ + fi && \ + yum install -y https://dl.grafana.com/enterprise/release/grafana-enterprise-${VERSION}-1.${BUILDARCH}.rpm && \ + yum clean all && \ + chmod 755 /entrypoint.sh + + +ENV PATH=/usr/share/grafana/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ + GF_PATHS_CONFIG="/etc/grafana/grafana.ini" \ + GF_PATHS_DATA="/var/lib/grafana" \ + GF_PATHS_HOME="/usr/share/grafana" \ + GF_PATHS_LOGS="/var/log/grafana" \ + GF_PATHS_PLUGINS="/var/lib/grafana/plugins" \ + GF_PATHS_PROVISIONING="/etc/grafana/provisioning" + +EXPOSE 3000 + +USER grafana +ENTRYPOINT [ "/entrypoint.sh" ] diff --git a/grafana/11.3.0/20.03-lts-sp4/entrypoint.sh b/grafana/11.3.0/20.03-lts-sp4/entrypoint.sh new file mode 100644 index 00000000..3c5ddf7e --- /dev/null +++ b/grafana/11.3.0/20.03-lts-sp4/entrypoint.sh @@ -0,0 +1,68 @@ +#!/bin/bash -e + +PERMISSIONS_OK=0 + +if [ ! -r "$GF_PATHS_CONFIG" ]; then + echo "GF_PATHS_CONFIG='$GF_PATHS_CONFIG' is not readable." + PERMISSIONS_OK=1 +fi + +if [ ! -w "$GF_PATHS_DATA" ]; then + echo "GF_PATHS_DATA='$GF_PATHS_DATA' is not writable." + PERMISSIONS_OK=1 +fi + +if [ ! -r "$GF_PATHS_HOME" ]; then + echo "GF_PATHS_HOME='$GF_PATHS_HOME' is not readable." + PERMISSIONS_OK=1 +fi + +if [ $PERMISSIONS_OK -eq 1 ]; then + echo "You may have issues with file permissions, more information here: http://docs.grafana.org/installation/docker/#migrate-to-v51-or-later" +fi + +if [ ! -d "$GF_PATHS_PLUGINS" ]; then + mkdir "$GF_PATHS_PLUGINS" +fi + +# Convert all environment variables with names ending in __FILE into the content of +# the file that they point at and use the name without the trailing __FILE. +# This can be used to carry in Docker secrets. +for VAR_NAME in $(env | grep '^GF_[^=]\+__FILE=.\+' | sed -r "s/([^=]*)__FILE=.*/\1/g"); do + VAR_NAME_FILE="$VAR_NAME"__FILE + if [ "${!VAR_NAME}" ]; then + echo >&2 "ERROR: Both $VAR_NAME and $VAR_NAME_FILE are set (but are exclusive)" + exit 1 + fi + echo "Getting secret $VAR_NAME from ${!VAR_NAME_FILE}" + export "$VAR_NAME"="$(< "${!VAR_NAME_FILE}")" + unset "$VAR_NAME_FILE" +done + +export HOME="$GF_PATHS_HOME" + +if [ ! -z "${GF_INSTALL_PLUGINS}" ]; then + OLDIFS=$IFS + IFS=',' + for plugin in ${GF_INSTALL_PLUGINS}; do + IFS=$OLDIFS + if [[ $plugin =~ .*\;.* ]]; then + pluginUrl=$(echo "$plugin" | cut -d';' -f 1) + pluginInstallFolder=$(echo "$plugin" | cut -d';' -f 2) + grafana-cli --pluginUrl ${pluginUrl} --pluginsDir "${GF_PATHS_PLUGINS}" plugins install "${pluginInstallFolder}" + else + grafana-cli --pluginsDir "${GF_PATHS_PLUGINS}" plugins install ${plugin} + fi + done +fi + +exec grafana-server \ + --homepath="$GF_PATHS_HOME" \ + --config="$GF_PATHS_CONFIG" \ + --packaging=docker \ + "$@" \ + cfg:default.log.mode="console" \ + cfg:default.paths.data="$GF_PATHS_DATA" \ + cfg:default.paths.logs="$GF_PATHS_LOGS" \ + cfg:default.paths.plugins="$GF_PATHS_PLUGINS" \ + cfg:default.paths.provisioning="$GF_PATHS_PROVISIONING" diff --git a/grafana/meta.yml b/grafana/meta.yml index f5b99ff1..b8d263d3 100644 --- a/grafana/meta.yml +++ b/grafana/meta.yml @@ -15,4 +15,6 @@ 11.3.0-oe2203sp4: path: grafana/11.3.0/22.03-lts-sp4/Dockerfile 11.3.0-oe2203sp1: - path: grafana/11.3.0/22.03-lts-sp1/Dockerfile \ No newline at end of file + path: grafana/11.3.0/22.03-lts-sp1/Dockerfile +11.3.0-oe2003sp4: + path: grafana/11.3.0/20.03-lts-sp4/Dockerfile \ No newline at end of file -- Gitee