From 8d169d0289eeea2f430c2a7d13c3f6bd845cfac1 Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Fri, 16 Aug 2024 09:15:23 +0200 Subject: [PATCH] Fix Dockerfile for CentOS Stream 10 Signed-off-by: Petr "Stone" Hracek --- 7/Dockerfile.c10s | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/7/Dockerfile.c10s b/7/Dockerfile.c10s index bda0deb..5585dc7 100644 --- a/7/Dockerfile.c10s +++ b/7/Dockerfile.c10s @@ -35,6 +35,15 @@ LABEL summary="$SUMMARY" \ EXPOSE 6379 +# Get prefix path and path to scripts rather than hard-code them in scripts +ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/valkey \ + VALKEY_PREFIX=/usr \ + VALKEY_CONF=/etc/valkey/valkey.conf \ + VALKEY_SOCK=/run/valkey/valkey.sock \ + VALKEY_LIB=/var/lib/valkey \ + VALKEY_RUN=/run/valkey + + # Create user for Valkey that has known UID # We need to do this before installing the RPMs which would create user with random UID # The UID is the one used by the default user from the parent layer (1001), @@ -51,8 +60,10 @@ RUN getent group valkey &> /dev/null || groupadd -r valkey &> /dev/null && \ rpm -V $INSTALL_PKGS && \ dnf -y clean all --enablerepo='*' && \ valkey-server --version | grep -qe "^Server v=$VALKEY_VERSION\." && echo "Found VERSION $VALKEY_VERSION" && \ - mkdir -p /var/lib/valkey/data && chown -R valkey.0 /var/lib/valkey && \ - mkdir -p /var/run/valkey && chown -R valkey.0 /var/run/valkey && \ + mkdir -p $VALKEY_LIB/data && chown -R valkey:0 $VALKEY_LIB && \ + mkdir -p $VALKEY_RUN && chown -R valkey:0 $VALKEY_RUN && \ + chmod -R ug+rwX $VALKEY_RUN && \ + chmod -R ug+rwX $VALKEY_LIB && \ [[ "$(id valkey)" == "uid=1001(valkey)"* ]] # Get prefix path and path to scripts rather than hard-code them in scripts