From 8027a7e5eca2efcb685de01ee4ce9fe6a3350950 Mon Sep 17 00:00:00 2001 From: Richard Steinmetz Date: Thu, 11 Jul 2024 18:22:39 +0200 Subject: [PATCH 1/4] 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"] From b8c1d78371a3f0bcd51d1db99c0cf82ee3bf18fb Mon Sep 17 00:00:00 2001 From: "Simon L." Date: Fri, 12 Jul 2024 10:24:56 +0200 Subject: [PATCH 2/4] update links to upstream docker files Signed-off-by: Simon L. --- Containers/postgresql/Dockerfile | 2 +- Containers/redis/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Containers/postgresql/Dockerfile b/Containers/postgresql/Dockerfile index 43cb2130..a4ab0fc5 100644 --- a/Containers/postgresql/Dockerfile +++ b/Containers/postgresql/Dockerfile @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:latest -# From https://github.com/docker-library/postgres/blob/master/15/alpine/Dockerfile +# From https://github.com/docker-library/postgres/blob/master/16/alpine3.20/Dockerfile FROM postgres:16.3-alpine COPY --chmod=775 start.sh /start.sh diff --git a/Containers/redis/Dockerfile b/Containers/redis/Dockerfile index 3bff0e1f..de776cbc 100644 --- a/Containers/redis/Dockerfile +++ b/Containers/redis/Dockerfile @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:latest -# From https://github.com/docker-library/redis/blob/master/7.0/alpine/Dockerfile +# From https://github.com/docker-library/redis/blob/master/7.2/alpine/Dockerfile FROM redis:7.2.5-alpine COPY --chmod=775 start.sh /start.sh From 22fbd73d92ae4164e7e7ff02f3949d8aad752cb2 Mon Sep 17 00:00:00 2001 From: "Simon L." Date: Fri, 12 Jul 2024 10:31:30 +0200 Subject: [PATCH 3/4] add link to httpd Signed-off-by: Simon L. --- Containers/apache/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Containers/apache/Dockerfile b/Containers/apache/Dockerfile index 964c235c..d8fc0410 100644 --- a/Containers/apache/Dockerfile +++ b/Containers/apache/Dockerfile @@ -1,6 +1,7 @@ # syntax=docker/dockerfile:latest FROM caddy:2.8.4-alpine AS caddy +# From https://github.com/docker-library/httpd/blob/master/2.4/alpine/Dockerfile FROM httpd:2.4.61-alpine3.20 COPY --from=caddy /usr/bin/caddy /usr/bin/caddy From e60dd31a355818b4acfbb99589888822a2349e40 Mon Sep 17 00:00:00 2001 From: "Simon L." Date: Fri, 12 Jul 2024 10:36:14 +0200 Subject: [PATCH 4/4] make it `rm -f` Signed-off-by: Simon L. --- Containers/postgresql/Dockerfile | 2 +- Containers/redis/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Containers/postgresql/Dockerfile b/Containers/postgresql/Dockerfile index a4ab0fc5..ff8de132 100644 --- a/Containers/postgresql/Dockerfile +++ b/Containers/postgresql/Dockerfile @@ -35,7 +35,7 @@ RUN set -ex; \ apk --no-cache del openssl; \ \ # Get rid of unused binaries - rm /usr/local/bin/gosu /usr/local/bin/su-exec; + rm -f /usr/local/bin/gosu /usr/local/bin/su-exec; VOLUME /mnt/data diff --git a/Containers/redis/Dockerfile b/Containers/redis/Dockerfile index de776cbc..d8a97f33 100644 --- a/Containers/redis/Dockerfile +++ b/Containers/redis/Dockerfile @@ -12,7 +12,7 @@ RUN set -ex; \ echo "root:$(openssl rand -base64 12)" | chpasswd; \ \ # Get rid of unused binaries - rm /usr/local/bin/gosu; + rm -f /usr/local/bin/gosu; USER redis ENTRYPOINT ["/start.sh"]