mirror of
https://github.com/bitnami/containers.git
synced 2026-10-18 05:59:59 +02:00
[bitnami/grafana] Ensure bitnami/grafana folder is created with usable permissions (#52255)
* Ensure bitnami/grafana folder is created with usable permissions This follows the examples of other images. Without this folder being created, mounting user init scripts leads to an error on startup: "mkdir: cannot create directory '/bitnami': Permission denied" fixes #52238 Signed-off-by: Ben Foster <bpfoster@gmail.com> * Adjust volume dir variable name and use grafana_env_var_value to reference it, per PR feedback Signed-off-by: Ben Foster <bpfoster@gmail.com> --------- Signed-off-by: Ben Foster <bpfoster@gmail.com>
This commit is contained in:
@@ -77,6 +77,7 @@ GF_INSTALL_PLUGINS="${GF_INSTALL_PLUGINS:-"${GRAFANA_PLUGINS:-}"}"
|
||||
export GF_INSTALL_PLUGINS="${GF_INSTALL_PLUGINS:-}"
|
||||
export GF_INSTALL_PLUGINS_SKIP_TLS="${GF_INSTALL_PLUGINS_SKIP_TLS:-yes}"
|
||||
export GF_FEATURE_TOGGLES="${GF_FEATURE_TOGGLES:-}"
|
||||
export GF_VOLUME_DIR="${BITNAMI_VOLUME_DIR}/grafana"
|
||||
export GRAFANA_MIGRATION_LOCK="${GRAFANA_MIGRATION_LOCK:-false}"
|
||||
export GRAFANA_SLEEP_TIME="${GRAFANA_SLEEP_TIME:-10}"
|
||||
export GRAFANA_RETRY_ATTEMPTS="${GRAFANA_RETRY_ATTEMPTS:-12}"
|
||||
|
||||
@@ -25,7 +25,7 @@ info "Creating system user"
|
||||
ensure_user_exists "$GRAFANA_DAEMON_USER" --group "$GRAFANA_DAEMON_GROUP" --system
|
||||
|
||||
info "Configuring file permissions"
|
||||
for dir in "$(grafana_env_var_value PATHS_DATA)" "$(grafana_env_var_value PATHS_LOGS)" "$(grafana_env_var_value PATHS_PLUGINS)" "$(grafana_env_var_value PATHS_PROVISIONING)"; do
|
||||
for dir in "$(grafana_env_var_value PATHS_DATA)" "$(grafana_env_var_value PATHS_LOGS)" "$(grafana_env_var_value PATHS_PLUGINS)" "$(grafana_env_var_value PATHS_PROVISIONING)" "$(grafana_env_var_value VOLUME_DIR)"; do
|
||||
ensure_dir_exists "$dir"
|
||||
# Use grafana:root ownership for compatibility when running as a non-root user
|
||||
configure_permissions_ownership "$dir" -d "775" -f "664" -u "$GRAFANA_DAEMON_USER" -g "root"
|
||||
|
||||
Reference in New Issue
Block a user