From 19cf11af194b717a2d630a824fed32a01cac88d4 Mon Sep 17 00:00:00 2001 From: openeuler_bot <673672685@qq.com> Date: Tue, 24 Jun 2025 08:39:16 +0000 Subject: [PATCH] 24.03-lts-sp1 update grafana to 12.0.2 --- Cloud/grafana/12.0.2/24.03-lts-sp1/Dockerfile | 31 +++++++++ .../12.0.2/24.03-lts-sp1/entrypoint.sh | 68 +++++++++++++++++++ Cloud/grafana/meta.yml | 4 +- 3 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 Cloud/grafana/12.0.2/24.03-lts-sp1/Dockerfile create mode 100644 Cloud/grafana/12.0.2/24.03-lts-sp1/entrypoint.sh diff --git a/Cloud/grafana/12.0.2/24.03-lts-sp1/Dockerfile b/Cloud/grafana/12.0.2/24.03-lts-sp1/Dockerfile new file mode 100644 index 0000000..0aa34b1 --- /dev/null +++ b/Cloud/grafana/12.0.2/24.03-lts-sp1/Dockerfile @@ -0,0 +1,31 @@ +ARG BASE=openeuler/openeuler:24.03-lts-sp1 +FROM ${BASE} + +ARG TARGETARCH +ARG BUILDARCH +ARG VERSION=12.0.2 + +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/Cloud/grafana/12.0.2/24.03-lts-sp1/entrypoint.sh b/Cloud/grafana/12.0.2/24.03-lts-sp1/entrypoint.sh new file mode 100644 index 0000000..3c5ddf7 --- /dev/null +++ b/Cloud/grafana/12.0.2/24.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/Cloud/grafana/meta.yml b/Cloud/grafana/meta.yml index 589305e..179addd 100644 --- a/Cloud/grafana/meta.yml +++ b/Cloud/grafana/meta.yml @@ -39,4 +39,6 @@ 11.4.0-oe2203sp4: path: 11.4.0/22.03-lts-sp4/Dockerfile 11.4.0-oe2203sp1: - path: 11.4.0/22.03-lts-sp1/Dockerfile \ No newline at end of file + path: 11.4.0/22.03-lts-sp1/Dockerfile +12.0.2-oe2403sp1: + path: Cloud/grafana/12.0.2/24.03-lts-sp1/Dockerfile \ No newline at end of file -- Gitee