From 8027a7e5eca2efcb685de01ee4ce9fe6a3350950 Mon Sep 17 00:00:00 2001 From: Richard Steinmetz Date: Thu, 11 Jul 2024 18:22:39 +0200 Subject: [PATCH] fix: remove unused go binaries from redis and postgresql images Both binaries gosu and su-exec are not used in our entrypoints. Signed-off-by: Richard Steinmetz --- Containers/postgresql/Dockerfile | 5 ++++- Containers/redis/Dockerfile | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Containers/postgresql/Dockerfile b/Containers/postgresql/Dockerfile index b98ea8e9..43cb2130 100644 --- a/Containers/postgresql/Dockerfile +++ b/Containers/postgresql/Dockerfile @@ -32,7 +32,10 @@ RUN set -ex; \ \ # Give root a random password echo "root:$(openssl rand -base64 12)" | chpasswd; \ - apk --no-cache del openssl; + apk --no-cache del openssl; \ + \ +# Get rid of unused binaries + rm /usr/local/bin/gosu /usr/local/bin/su-exec; VOLUME /mnt/data diff --git a/Containers/redis/Dockerfile b/Containers/redis/Dockerfile index 03ec115e..3bff0e1f 100644 --- a/Containers/redis/Dockerfile +++ b/Containers/redis/Dockerfile @@ -9,7 +9,10 @@ RUN set -ex; \ apk add --no-cache openssl bash; \ \ # Give root a random password - echo "root:$(openssl rand -base64 12)" | chpasswd + echo "root:$(openssl rand -base64 12)" | chpasswd; \ + \ +# Get rid of unused binaries + rm /usr/local/bin/gosu; USER redis ENTRYPOINT ["/start.sh"]