diff --git a/bitnami/redis/7.0/debian-11/Dockerfile b/bitnami/redis/7.0/debian-11/Dockerfile index c3bb1d3bd6fd..edd22eb90d5b 100644 --- a/bitnami/redis/7.0/debian-11/Dockerfile +++ b/bitnami/redis/7.0/debian-11/Dockerfile @@ -3,10 +3,10 @@ FROM docker.io/bitnami/minideb:bullseye ARG TARGETARCH LABEL org.opencontainers.image.base.name="docker.io/bitnami/minideb:bullseye" \ - org.opencontainers.image.created="2023-04-10T22:55:23Z" \ + org.opencontainers.image.created="2023-04-13T23:22:01Z" \ org.opencontainers.image.description="Application packaged by VMware, Inc" \ org.opencontainers.image.licenses="Apache-2.0" \ - org.opencontainers.image.ref.name="7.0.10-debian-11-r7" \ + org.opencontainers.image.ref.name="7.0.10-debian-11-r8" \ org.opencontainers.image.title="redis" \ org.opencontainers.image.vendor="VMware, Inc." \ org.opencontainers.image.version="7.0.10" diff --git a/bitnami/redis/7.0/debian-11/rootfs/opt/bitnami/scripts/libredis.sh b/bitnami/redis/7.0/debian-11/rootfs/opt/bitnami/scripts/libredis.sh index 643bd1431d07..976b056b17bc 100644 --- a/bitnami/redis/7.0/debian-11/rootfs/opt/bitnami/scripts/libredis.sh +++ b/bitnami/redis/7.0/debian-11/rootfs/opt/bitnami/scripts/libredis.sh @@ -54,7 +54,12 @@ redis_conf_set() { value="${value//[$'\t\n\r']}" [[ "$value" = "" ]] && value="\"$value\"" - replace_in_file "${REDIS_BASE_DIR}/etc/redis.conf" "^#*\s*${key} .*" "${key} ${value}" false + # Determine whether to enable the configuration for RDB persistence, if yes, do not enable the replacement operation + if [ "${key}" == "save" ];then + echo "${key} ${value}" >> "${REDIS_BASE_DIR}/etc/redis.conf" + else + replace_in_file "${REDIS_BASE_DIR}/etc/redis.conf" "^#*\s*${key} .*" "${key} ${value}" false + fi } ######################## @@ -399,6 +404,16 @@ redis_configure_default() { # Enable AOF https://redis.io/topics/persistence#append-only-file # Leave default fsync (every second) redis_conf_set appendonly "${REDIS_AOF_ENABLED}" + + #The value stored in $i here is the number of seconds and times of save rules in redis rdb mode + if [ -z "${REDIS_RDB_POLICY}" ];then + redis_conf_set save "" + else + for i in ${REDIS_RDB_POLICY};do + redis_conf_set save "${i//#/ }" + done + fi + redis_conf_set port "$REDIS_PORT_NUMBER" # TLS configuration if is_boolean_yes "$REDIS_TLS_ENABLED"; then diff --git a/bitnami/redis/7.0/debian-11/rootfs/opt/bitnami/scripts/redis-env.sh b/bitnami/redis/7.0/debian-11/rootfs/opt/bitnami/scripts/redis-env.sh index 6d761511645b..5f20cd833f28 100644 --- a/bitnami/redis/7.0/debian-11/rootfs/opt/bitnami/scripts/redis-env.sh +++ b/bitnami/redis/7.0/debian-11/rootfs/opt/bitnami/scripts/redis-env.sh @@ -27,6 +27,7 @@ redis_env_vars=( REDIS_DISABLE_COMMANDS REDIS_DATABASE REDIS_AOF_ENABLED + REDIS_RDB_POLICY REDIS_MASTER_HOST REDIS_MASTER_PORT_NUMBER REDIS_PORT_NUMBER @@ -90,6 +91,7 @@ export REDIS_DAEMON_GROUP="redis" export REDIS_DISABLE_COMMANDS="${REDIS_DISABLE_COMMANDS:-}" export REDIS_DATABASE="${REDIS_DATABASE:-redis}" export REDIS_AOF_ENABLED="${REDIS_AOF_ENABLED:-yes}" +export REDIS_RDB_POLICY="${REDIS_RDB_POLICY:-}" export REDIS_MASTER_HOST="${REDIS_MASTER_HOST:-}" export REDIS_MASTER_PORT_NUMBER="${REDIS_MASTER_PORT_NUMBER:-6379}" export REDIS_DEFAULT_PORT_NUMBER="6379" # only used at build time