From 094cbbbdcf05a6a14d4f7815ade0b942eecff858 Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Sun, 17 May 2026 23:00:33 -0400 Subject: [PATCH 1/4] Remove EOL versions of Redis, fix entrypoint --- redis/5/Dockerfile | 20 -------------------- redis/6/Dockerfile | 20 -------------------- redis/8/Dockerfile | 2 +- redis/entrypoint.sh | 22 ++++++++++++++++++---- 4 files changed, 19 insertions(+), 45 deletions(-) delete mode 100644 redis/5/Dockerfile delete mode 100644 redis/6/Dockerfile diff --git a/redis/5/Dockerfile b/redis/5/Dockerfile deleted file mode 100644 index aab5eff02..000000000 --- a/redis/5/Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -# ---------------------------------- -# Environment: redis -# ---------------------------------- -FROM --platform=$TARGETOS/$TARGETARCH redis:5-bullseye - -LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" - -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt -y update && \ - apt -y upgrade && \ - apt -y install iproute2 && \ - useradd -d /home/container -m container -s /bin/bash - -USER container -ENV USER=container HOME=/home/container -WORKDIR /home/container - -COPY ../entrypoint.sh /entrypoint.sh -CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/redis/6/Dockerfile b/redis/6/Dockerfile deleted file mode 100644 index e8a95e5de..000000000 --- a/redis/6/Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -# ---------------------------------- -# Environment: redis -# ---------------------------------- -FROM --platform=$TARGETOS/$TARGETARCH redis:6-bookworm - -LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" - -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt -y update && \ - apt -y upgrade && \ - apt -y install iproute2 && \ - useradd -d /home/container -m container -s /bin/bash - -USER container -ENV USER=container HOME=/home/container -WORKDIR /home/container - -COPY ../entrypoint.sh /entrypoint.sh -CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/redis/8/Dockerfile b/redis/8/Dockerfile index 6b5c06f82..204558ca8 100644 --- a/redis/8/Dockerfile +++ b/redis/8/Dockerfile @@ -1,7 +1,7 @@ # ---------------------------------- # Environment: redis # ---------------------------------- -FROM --platform=$TARGETOS/$TARGETARCH redis:8-bookworm +FROM --platform=$TARGETOS/$TARGETARCH redis:8-trixie ENV DEBIAN_FRONTEND=noninteractive diff --git a/redis/entrypoint.sh b/redis/entrypoint.sh index 6e19f17ac..c2ce53acb 100644 --- a/redis/entrypoint.sh +++ b/redis/entrypoint.sh @@ -1,13 +1,27 @@ #!/bin/bash cd /home/container -# Make internal Docker IP address available to processes. INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') export INTERNAL_IP -# Replace Startup Variables MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') echo ":/home/container$ ${MODIFIED_STARTUP}" -# Run the Server -eval ${MODIFIED_STARTUP} +eval ${MODIFIED_STARTUP} & +REDIS_PID=$! + +trap 'kill -TERM $REDIS_PID 2>/dev/null; wait $REDIS_PID; exit' TERM INT + +for i in $(seq 1 60); do + if /usr/local/bin/redis-cli -p "${SERVER_PORT}" -a "${SERVER_PASSWORD}" --no-auth-warning PING 2>/dev/null | grep -q PONG; then + break + fi + sleep 0.5 +done + +while IFS= read -r line; do + [ -z "$line" ] && continue + printf '%s\n' "$line" | /usr/local/bin/redis-cli -p "${SERVER_PORT}" -a "${SERVER_PASSWORD}" --no-auth-warning +done + +wait $REDIS_PID \ No newline at end of file From b66597a7cc5d9ad15c3f230245340c0db08e0a90 Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Sun, 17 May 2026 23:13:55 -0400 Subject: [PATCH 2/4] Shutdowns --- redis/entrypoint.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/redis/entrypoint.sh b/redis/entrypoint.sh index c2ce53acb..ea89f7950 100644 --- a/redis/entrypoint.sh +++ b/redis/entrypoint.sh @@ -10,7 +10,12 @@ echo ":/home/container$ ${MODIFIED_STARTUP}" eval ${MODIFIED_STARTUP} & REDIS_PID=$! -trap 'kill -TERM $REDIS_PID 2>/dev/null; wait $REDIS_PID; exit' TERM INT +shutdown() { + /usr/local/bin/redis-cli -p "${SERVER_PORT}" -a "${SERVER_PASSWORD}" --no-auth-warning SHUTDOWN NOSAVE 2>/dev/null + wait $REDIS_PID 2>/dev/null + exit 0 +} +trap shutdown TERM INT for i in $(seq 1 60); do if /usr/local/bin/redis-cli -p "${SERVER_PORT}" -a "${SERVER_PASSWORD}" --no-auth-warning PING 2>/dev/null | grep -q PONG; then @@ -19,9 +24,12 @@ for i in $(seq 1 60); do sleep 0.5 done -while IFS= read -r line; do - [ -z "$line" ] && continue - printf '%s\n' "$line" | /usr/local/bin/redis-cli -p "${SERVER_PORT}" -a "${SERVER_PASSWORD}" --no-auth-warning -done +( + while IFS= read -r line; do + [ -z "$line" ] && continue + printf '%s\n' "$line" | /usr/local/bin/redis-cli -p "${SERVER_PORT}" -a "${SERVER_PASSWORD}" --no-auth-warning + done +) & +READER_PID=$! wait $REDIS_PID \ No newline at end of file From 5edd286cba5200006b39edf418c4fa04b52b8179 Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Sun, 17 May 2026 23:16:28 -0400 Subject: [PATCH 3/4] Revert "Shutdowns" This reverts commit b66597a7cc5d9ad15c3f230245340c0db08e0a90. --- redis/entrypoint.sh | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/redis/entrypoint.sh b/redis/entrypoint.sh index ea89f7950..c2ce53acb 100644 --- a/redis/entrypoint.sh +++ b/redis/entrypoint.sh @@ -10,12 +10,7 @@ echo ":/home/container$ ${MODIFIED_STARTUP}" eval ${MODIFIED_STARTUP} & REDIS_PID=$! -shutdown() { - /usr/local/bin/redis-cli -p "${SERVER_PORT}" -a "${SERVER_PASSWORD}" --no-auth-warning SHUTDOWN NOSAVE 2>/dev/null - wait $REDIS_PID 2>/dev/null - exit 0 -} -trap shutdown TERM INT +trap 'kill -TERM $REDIS_PID 2>/dev/null; wait $REDIS_PID; exit' TERM INT for i in $(seq 1 60); do if /usr/local/bin/redis-cli -p "${SERVER_PORT}" -a "${SERVER_PASSWORD}" --no-auth-warning PING 2>/dev/null | grep -q PONG; then @@ -24,12 +19,9 @@ for i in $(seq 1 60); do sleep 0.5 done -( - while IFS= read -r line; do - [ -z "$line" ] && continue - printf '%s\n' "$line" | /usr/local/bin/redis-cli -p "${SERVER_PORT}" -a "${SERVER_PASSWORD}" --no-auth-warning - done -) & -READER_PID=$! +while IFS= read -r line; do + [ -z "$line" ] && continue + printf '%s\n' "$line" | /usr/local/bin/redis-cli -p "${SERVER_PORT}" -a "${SERVER_PASSWORD}" --no-auth-warning +done wait $REDIS_PID \ No newline at end of file From f835e3af8a1e6a615888478a857f8c490a55a6a1 Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Sun, 17 May 2026 23:20:46 -0400 Subject: [PATCH 4/4] try a different approach --- redis/entrypoint.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/redis/entrypoint.sh b/redis/entrypoint.sh index c2ce53acb..5ad62f1a1 100644 --- a/redis/entrypoint.sh +++ b/redis/entrypoint.sh @@ -10,8 +10,6 @@ echo ":/home/container$ ${MODIFIED_STARTUP}" eval ${MODIFIED_STARTUP} & REDIS_PID=$! -trap 'kill -TERM $REDIS_PID 2>/dev/null; wait $REDIS_PID; exit' TERM INT - for i in $(seq 1 60); do if /usr/local/bin/redis-cli -p "${SERVER_PORT}" -a "${SERVER_PASSWORD}" --no-auth-warning PING 2>/dev/null | grep -q PONG; then break @@ -19,9 +17,13 @@ for i in $(seq 1 60); do sleep 0.5 done -while IFS= read -r line; do - [ -z "$line" ] && continue - printf '%s\n' "$line" | /usr/local/bin/redis-cli -p "${SERVER_PORT}" -a "${SERVER_PASSWORD}" --no-auth-warning -done +( + while IFS= read -r line; do + [ -z "$line" ] && continue + printf '%s\n' "$line" | /usr/local/bin/redis-cli -p "${SERVER_PORT}" -a "${SERVER_PASSWORD}" --no-auth-warning + done +) < /dev/stdin & +READER_PID=$! -wait $REDIS_PID \ No newline at end of file +wait $REDIS_PID +kill $READER_PID 2>/dev/null \ No newline at end of file