From e4648ab03ef136f54f331dd8e131b1b783378d24 Mon Sep 17 00:00:00 2001 From: Zoey Date: Wed, 3 May 2023 16:36:29 +0200 Subject: [PATCH 1/4] optimize redis Dockerfile Signed-off-by: Zoey --- Containers/redis/Dockerfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Containers/redis/Dockerfile b/Containers/redis/Dockerfile index 9720efab..b68d0569 100644 --- a/Containers/redis/Dockerfile +++ b/Containers/redis/Dockerfile @@ -1,13 +1,12 @@ # From https://github.com/docker-library/redis/blob/master/7.0/alpine/Dockerfile FROM redis:7.0.11-alpine -RUN apk add --no-cache openssl bash - -COPY start.sh /usr/bin/ -RUN chmod +x /usr/bin/start.sh +COPY --chmod=775 start.sh /usr/bin/start.sh +RUN apk add --no-cache openssl bash; \ + \ # Give root a random password -RUN echo "root:$(openssl rand -base64 12)" | chpasswd + echo "root:$(openssl rand -base64 12)" | chpasswd USER redis ENTRYPOINT ["start.sh"] From a4e894092c149fbe6fae7ffe88871a378ad74c42 Mon Sep 17 00:00:00 2001 From: Zoey Date: Wed, 3 May 2023 17:10:38 +0200 Subject: [PATCH 2/4] add suggestion Co-authored-by: Simon L. Signed-off-by: Zoey --- Containers/redis/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Containers/redis/Dockerfile b/Containers/redis/Dockerfile index b68d0569..53b4781a 100644 --- a/Containers/redis/Dockerfile +++ b/Containers/redis/Dockerfile @@ -5,7 +5,7 @@ COPY --chmod=775 start.sh /usr/bin/start.sh RUN apk add --no-cache openssl bash; \ \ -# Give root a random password + # Give root a random password echo "root:$(openssl rand -base64 12)" | chpasswd USER redis From 55bc84d3f2b51eac5c8a178233b2f238bd171c1a Mon Sep 17 00:00:00 2001 From: Zoey Date: Wed, 3 May 2023 17:10:47 +0200 Subject: [PATCH 3/4] add set -ex Co-authored-by: Simon L. Signed-off-by: Zoey --- Containers/redis/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Containers/redis/Dockerfile b/Containers/redis/Dockerfile index 53b4781a..cd19d005 100644 --- a/Containers/redis/Dockerfile +++ b/Containers/redis/Dockerfile @@ -3,7 +3,8 @@ FROM redis:7.0.11-alpine COPY --chmod=775 start.sh /usr/bin/start.sh -RUN apk add --no-cache openssl bash; \ +RUN set -ex; \ + apk add --no-cache openssl bash; \ \ # Give root a random password echo "root:$(openssl rand -base64 12)" | chpasswd From 3e1ae33e951d3bbc16d6b7432fb027f51616cf14 Mon Sep 17 00:00:00 2001 From: Simon L Date: Wed, 3 May 2023 17:31:43 +0200 Subject: [PATCH 4/4] Update Containers/redis/Dockerfile Signed-off-by: Simon L. --- Containers/redis/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Containers/redis/Dockerfile b/Containers/redis/Dockerfile index cd19d005..5bec5f8e 100644 --- a/Containers/redis/Dockerfile +++ b/Containers/redis/Dockerfile @@ -6,7 +6,7 @@ COPY --chmod=775 start.sh /usr/bin/start.sh RUN set -ex; \ apk add --no-cache openssl bash; \ \ - # Give root a random password +# Give root a random password echo "root:$(openssl rand -base64 12)" | chpasswd USER redis