diff --git a/Database/redis/8.0.2/24.03-lts-sp1/Dockerfile b/Database/redis/8.0.2/24.03-lts-sp1/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ffb3b949bd9e208d463ee66e697ff4cb301437ab --- /dev/null +++ b/Database/redis/8.0.2/24.03-lts-sp1/Dockerfile @@ -0,0 +1,57 @@ +ARG BASE=openeuler/openeuler:24.03-lts +FROM ${BASE} + +ARG TARGETARCH +ARG VERSION=7.4.1 + +RUN yum -y update; \ + yum -y install findutils wget gcc make glibc-devel openssl-devel ca-certificates shadow-utils g++; \ + groupadd -r -g 909 redis; \ + useradd -r -g redis -u 909 redis + +ENV GOSU_VERSION 1.17 +RUN wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-${TARGETARCH}"; \ + chmod +x /usr/local/bin/gosu; \ + wget -O redis.tar.gz https://github.com/redis/redis/archive/refs/tags/${VERSION}.tar.gz; \ + mkdir -p /redis; tar -vxzf redis.tar.gz -C /redis --strip-components=1; \ + rm -rf redis.tar.gz; \ + grep -E '^ *createBoolConfig[(]"protected-mode",.*, *1 *,.*[)],$' /redis/src/config.c; \ + sed -ri 's!^( *createBoolConfig[(]"protected-mode",.*, *)1( *,.*[)],)$!\10\2!' /redis/src/config.c; \ + grep -E '^ *createBoolConfig[(]"protected-mode",.*, *0 *,.*[)],$' /redis/src/config.c; \ + extraJemallocConfigureFlags="--build=$TARGETARCH"; \ + case "${TARGETARCH}" in \ + amd64) extraJemallocConfigureFlags="$extraJemallocConfigureFlags --with-lg-page=12" ;; \ + *) extraJemallocConfigureFlags="$extraJemallocConfigureFlags --with-lg-page=16" ;; \ + esac; \ + extraJemallocConfigureFlags="$extraJemallocConfigureFlags --with-lg-hugepage=21"; \ + grep -F 'cd jemalloc && ./configure ' /redis/deps/Makefile; \ + sed -ri 's!cd jemalloc && ./configure !&'"$extraJemallocConfigureFlags"' !' /redis/deps/Makefile; \ + grep -F "cd jemalloc && ./configure $extraJemallocConfigureFlags " /redis/deps/Makefile; \ + export BUILD_TLS=yes; \ + make -C /redis/deps/fast_float; \ + make -C /redis -j "$(nproc)" all MALLOC=libc; \ + make -C /redis install + +COPY entrypoint.sh / +RUN serverMd5="$(md5sum /usr/local/bin/redis-server | cut -d' ' -f1)"; export serverMd5; \ + find /usr/local/bin/redis* -maxdepth 0 \ + -type f -not -name redis-server \ + -exec sh -eux -c ' \ + md5="$(md5sum "$1" | cut -d" " -f1)"; \ + test "$md5" = "$serverMd5"; \ + ' -- '{}' ';' \ + -exec ln -svfT 'redis-server' '{}' ';' \ + ; \ + rm -rf /redis; \ + chmod 755 /entrypoint.sh; \ + mkdir /data; chown redis:redis /data; \ + yum -y remove wget gcc make; \ + yum clean all + +VOLUME /data +WORKDIR /data + +ENTRYPOINT ["/entrypoint.sh"] + +EXPOSE 6379 +CMD ["redis-server"] \ No newline at end of file diff --git a/Database/redis/8.0.2/24.03-lts-sp1/entrypoint.sh b/Database/redis/8.0.2/24.03-lts-sp1/entrypoint.sh new file mode 100644 index 0000000000000000000000000000000000000000..16ecb3e84c57b1664f1d7de211d62d0bed1370e3 --- /dev/null +++ b/Database/redis/8.0.2/24.03-lts-sp1/entrypoint.sh @@ -0,0 +1,21 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +# or first arg is `something.conf` +if [ "${1#-}" != "$1" ] || [ "${1%.conf}" != "$1" ]; then + set -- redis-server "$@" +fi + +# allow the container to be started with `--user` +if [ "$1" = 'redis-server' -a "$(id -u)" = '0' ]; then + find . \! -user redis -exec chown redis '{}' + + exec gosu redis "$0" "$@" +fi + +um="$(umask)" +if [ "$um" = '0022' ]; then + umask 0077 +fi + +exec "$@" \ No newline at end of file diff --git a/Database/redis/meta.yml b/Database/redis/meta.yml index 1e9beff3abe6bd63e8bdd721026a5592ef8ae18d..fa14052f2846278a90d6c37270a17cbff40c531d 100644 --- a/Database/redis/meta.yml +++ b/Database/redis/meta.yml @@ -13,4 +13,6 @@ 7.4.1-oe2203sp4: path: 7.4.1/22.03-lts-sp4/Dockerfile 7.4.1-oe2403lts: - path: 7.4.1/24.03-lts/Dockerfile \ No newline at end of file + path: 7.4.1/24.03-lts/Dockerfile +8.0.2-oe2403sp1: + path: Database/redis/8.0.2/24.03-lts-sp1/Dockerfile \ No newline at end of file