8.0.3-debian-10-r0 release

This commit is contained in:
Bitnami Bot
2021-06-30 10:57:47 +00:00
parent e659104a68
commit d8dcde590c
9 changed files with 227 additions and 2 deletions

View File

@@ -0,0 +1,30 @@
FROM docker.io/bitnami/minideb:buster
LABEL maintainer "Bitnami <containers@bitnami.com>"
ENV HOME="/" \
OS_ARCH="amd64" \
OS_FLAVOUR="debian-10" \
OS_NAME="linux"
COPY prebuildfs /
# Install required system packages and dependencies
RUN install_packages ca-certificates curl gzip libc6 libfontconfig procps tar wget
RUN wget -nc -P /tmp/bitnami/pkg/cache/ https://downloads.bitnami.com/files/stacksmith/grafana-8.0.3-0-linux-amd64-debian-10.tar.gz && \
echo "47dc9af6185045e8f5d2c9267a34e482ded6ca9cd8e11243efbda4c60aceed20 /tmp/bitnami/pkg/cache/grafana-8.0.3-0-linux-amd64-debian-10.tar.gz" | sha256sum -c - && \
tar -zxf /tmp/bitnami/pkg/cache/grafana-8.0.3-0-linux-amd64-debian-10.tar.gz -P --transform 's|^[^/]*/files|/opt/bitnami|' --wildcards '*/files' && \
rm -rf /tmp/bitnami/pkg/cache/grafana-8.0.3-0-linux-amd64-debian-10.tar.gz
RUN chmod g+rwX /opt/bitnami
RUN mkdir -p /opt/bitnami/grafana/data/ /opt/bitnami/grafana/logs/ && chown -R 1001:root /opt/bitnami/grafana/data/ /opt/bitnami/grafana/logs/ && chmod g+rwX /opt/bitnami/grafana/data/ /opt/bitnami/grafana/logs/
RUN mv /opt/bitnami/grafana/conf/sample.ini /opt/bitnami/grafana/conf/grafana.ini
COPY rootfs /
RUN /grafana-plugins.sh
ENV BITNAMI_APP_NAME="grafana" \
BITNAMI_IMAGE_VERSION="8.0.3-debian-10-r0" \
PATH="/opt/bitnami/grafana/bin:$PATH"
EXPOSE 3000
WORKDIR /opt/bitnami/grafana
USER 1001
ENTRYPOINT [ "/run.sh" ]

View File

@@ -0,0 +1,14 @@
version: '2'
services:
grafana:
image: docker.io/bitnami/grafana:8
ports:
- '3000:3000'
environment:
- 'GF_SECURITY_ADMIN_PASSWORD=bitnami'
volumes:
- grafana_data:/opt/bitnami/grafana/data
volumes:
grafana_data:
driver: local

View File

@@ -0,0 +1,9 @@
{
"grafana": {
"arch": "amd64",
"digest": "47dc9af6185045e8f5d2c9267a34e482ded6ca9cd8e11243efbda4c60aceed20",
"distro": "debian-10",
"type": "NAMI",
"version": "8.0.3-0"
}
}

View File

@@ -0,0 +1,3 @@
Bitnami containers ship with software bundles. You can find the licenses under:
/opt/bitnami/nami/COPYING
/opt/bitnami/[name-of-bundle]/licenses/[bundle-version].txt

View File

@@ -0,0 +1,24 @@
#!/bin/sh
set -e
set -u
export DEBIAN_FRONTEND=noninteractive
n=0
max=2
until [ $n -gt $max ]; do
set +e
(
apt-get update -qq &&
apt-get install -y --no-install-recommends "$@"
)
CODE=$?
set -e
if [ $CODE -eq 0 ]; then
break
fi
if [ $n -eq $max ]; then
exit $CODE
fi
echo "apt failed, retrying"
n=$(($n + 1))
done
rm -r /var/lib/apt/lists /var/cache/apt/archives

View File

@@ -0,0 +1,37 @@
#!/bin/bash
grafana_install_plugin_command="/opt/bitnami/grafana/bin/grafana-cli"
grafana_install_plugin_args=("--pluginsDir" "/opt/bitnami/grafana/data/plugins" "plugins" "install")
grafana_plugin_list=(
"grafana-clock-panel"
"grafana-piechart-panel"
"michaeldmoore-annunciator-panel"
"briangann-gauge-panel"
"briangann-datatable-panel"
"jdbranham-diagram-panel"
"natel-discrete-panel"
"digiapulssi-organisations-panel"
"vonage-status-panel"
"neocat-cal-heatmap-panel"
"agenty-flowcharting-panel"
"larona-epict-panel"
"pierosavi-imageit-panel"
"michaeldmoore-multistat-panel"
"grafana-polystat-panel"
"scadavis-synoptic-panel"
"marcuscalidus-svg-panel"
"snuids-trafficlights-panel"
)
for plugin in "${grafana_plugin_list[@]}"; do
echo Installing "$plugin"
"${grafana_install_plugin_command[@]}" "${grafana_install_plugin_args[@]}" "${plugin}"
done
chmod g+rwX /opt/bitnami/grafana/data/plugins
# The Grafana Helm chart mounts the data directory at "/opt/bitnami/grafana/data"
# Therefore, all the plugins installed when building the image will be lost
# As a workaround, we can move them to a "default-plugins" directory and recover them
# during the 1st boot of the container
mkdir -p /opt/bitnami/grafana/default-plugins
mv /opt/bitnami/grafana/data/plugins/* /opt/bitnami/grafana/default-plugins/

View File

@@ -0,0 +1,108 @@
#!/bin/bash -e
# shellcheck disable=SC2034
: "${GF_PATHS_CONFIG:=/opt/bitnami/grafana/conf/grafana.ini}"
: "${GF_PATHS_DATA:=/opt/bitnami/grafana/data}"
: "${GF_PATHS_LOGS:=/opt/bitnami/grafana/logs}"
: "${GF_PATHS_PLUGINS:=/opt/bitnami/grafana/data/plugins}"
: "${GF_PATHS_DEFAULT_PLUGINS:=/opt/bitnami/grafana/default-plugins}"
: "${GF_PATHS_PROVISIONING:=/opt/bitnami/grafana/conf/provisioning}"
# Ensure compatibility with the Grafana Operator
grafana_operator_compatibility() {
# Based on https://github.com/integr8ly/grafana-operator/tree/master/pkg/controller/config/controller_config.go
local -r GF_OP_PATHS_CONFIG='/etc/grafana/grafana.ini'
local -r GF_OP_PATHS_DATA='/var/lib/grafana'
local -r GF_OP_PATHS_LOGS='/var/log/grafana'
local -r GF_OP_PATHS_PROVISIONING='/etc/grafana/provisioning'
local -a path_suffixes=('config' 'data' 'logs' 'provisioning')
for suffix in "${path_suffixes[@]}"; do
local gf_op_var="GF_OP_PATHS_${suffix^^}"
local gf_var="GF_PATHS_${suffix^^}"
if [[ -e "${!gf_op_var}" ]] && [[ "${!gf_op_var}" != "${!gf_var}" ]]; then
echo "Ensuring '${!gf_var}' points to '${!gf_op_var}'"
rm -rf "${!gf_var}"
ln -sfn "${!gf_op_var}" "${!gf_var}"
fi
done
}
# Use operator-compatible environment variable to install plugins. Useful to use the image as initContainer
grafana_operator_plugins_init() {
# Based on https://github.com/integr8ly/grafana-operator/blob/master/pkg/controller/grafana/pluginsHelper.go
local -r GF_OP_PLUGINS_INIT_DIR='/opt/plugins'
if [[ -d "$GF_OP_PLUGINS_INIT_DIR" ]]; then
echo "Detected '${GF_OP_PLUGINS_INIT_DIR}' dir. The container will run as grafana-operator plugins init"
if [[ -n "$GRAFANA_PLUGINS" ]]; then
export GF_INSTALL_PLUGINS="$GRAFANA_PLUGINS"
export GF_PATHS_PLUGINS="$GF_OP_PLUGINS_INIT_DIR"
grafana_install_plugins
fi
exit 0
fi
}
# Recover plugins installed when building the image
grafana_recover_default_plugins() {
if [[ ! -e "$GF_PATHS_PLUGINS" ]] || [[ -z "$(ls -A "$GF_PATHS_PLUGINS")" ]]; then
mkdir -p "$GF_PATHS_PLUGINS"
if [[ -e "$GF_PATHS_DEFAULT_PLUGINS" ]] && [[ -n "$(ls -A "$GF_PATHS_DEFAULT_PLUGINS")" ]]; then
cp -r "$GF_PATHS_DEFAULT_PLUGINS"/* "$GF_PATHS_PLUGINS"
fi
fi
}
# Install plugins
grafana_install_plugins() {
if [[ -n "$GF_INSTALL_PLUGINS" ]]; then
splitted_plugin_list=$(tr ',;' ' ' <<< "${GF_INSTALL_PLUGINS}")
read -r -a gf_plugins_list <<< "$splitted_plugin_list"
for plugin in "${gf_plugins_list[@]}"; do
grafana_install_plugin_args=("--pluginsDir" "$GF_PATHS_PLUGINS")
plugin_id="$plugin"
plugin_version=""
if echo "$plugin" | grep "=" > /dev/null 2>&1; then
splitted_plugin_entry=$(tr '=' ' ' <<< "${plugin}")
read -r -a plugin_url_array <<< "$splitted_plugin_entry"
echo "Installing plugin with id ${plugin_url_array[0]} and url ${plugin_url_array[1]}"
plugin_id="${plugin_url_array[0]}"
grafana_install_plugin_args+=("--pluginUrl" "${plugin_url_array[1]}")
elif echo "$plugin" | grep ":" > /dev/null 2>&1; then
splitted_plugin_entry=$(tr ':' ' ' <<< "${plugin}")
read -r -a plugin_id_version_array <<< "$splitted_plugin_entry"
plugin_id="${plugin_id_version_array[0]}"
plugin_version="${plugin_id_version_array[1]}"
echo "Installing plugin ${plugin_id} @ ${plugin_version}"
else
echo "Installing plugin with id ${plugin_id}"
fi
if [[ "${GF_INSTALL_PLUGINS_SKIP_TLS:-}" = "yes" ]]; then
grafana_install_plugin_args+=("--insecure")
fi
grafana_install_plugin_args+=("plugins" "install" "${plugin_id}")
if [[ -n "$plugin_version" ]]; then
grafana_install_plugin_args+=("$plugin_version")
fi
grafana-cli "${grafana_install_plugin_args[@]}"
done
fi
}
grafana_operator_compatibility
grafana_operator_plugins_init
grafana_recover_default_plugins
grafana_install_plugins
exec /opt/bitnami/grafana/bin/grafana-server \
--homepath=/opt/bitnami/grafana/ \
--config="$GF_PATHS_CONFIG" \
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" \
"$@"

View File

@@ -36,7 +36,7 @@ Non-root container images add an extra layer of security and are generally recom
Learn more about the Bitnami tagging policy and the difference between rolling tags and immutable tags [in our documentation page](https://docs.bitnami.com/tutorials/understand-rolling-tags-containers/).
* [`8`, `8-debian-10`, `8.0.3`, `8.0.3-debian-10-r-1`, `latest` (8/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-grafana/blob/8.0.3-debian-10-r-1/8/debian-10/Dockerfile)
* [`8`, `8-debian-10`, `8.0.3`, `8.0.3-debian-10-r0`, `latest` (8/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-grafana/blob/8.0.3-debian-10-r0/8/debian-10/Dockerfile)
* [`7`, `7-debian-10`, `7.5.9`, `7.5.9-debian-10-r5` (7/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-grafana/blob/7.5.9-debian-10-r5/7/debian-10/Dockerfile)
Subscribe to project updates by watching the [bitnami/grafana GitHub repo](https://github.com/bitnami/bitnami-docker-grafana).

View File

@@ -2,7 +2,7 @@ version: '2'
services:
grafana:
image: docker.io/bitnami/grafana:7
image: docker.io/bitnami/grafana:8
ports:
- '3000:3000'
environment: