Merge pull request #4973 from nextcloud/fix/remove-unused-go-binaries

fix: remove unused go binaries from redis and postgresql images
This commit is contained in:
Simon L. 2024-07-18 09:33:10 +02:00 committed by GitHub
commit ba10373ccc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 4 deletions

View file

@ -1,6 +1,7 @@
# syntax=docker/dockerfile:latest # syntax=docker/dockerfile:latest
FROM caddy:2.8.4-alpine AS caddy 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 FROM httpd:2.4.61-alpine3.20
COPY --from=caddy /usr/bin/caddy /usr/bin/caddy COPY --from=caddy /usr/bin/caddy /usr/bin/caddy

View file

@ -1,5 +1,5 @@
# syntax=docker/dockerfile:latest # 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 FROM postgres:16.3-alpine
COPY --chmod=775 start.sh /start.sh COPY --chmod=775 start.sh /start.sh
@ -32,7 +32,10 @@ RUN set -ex; \
\ \
# Give root a random password # Give root a random password
echo "root:$(openssl rand -base64 12)" | chpasswd; \ echo "root:$(openssl rand -base64 12)" | chpasswd; \
apk --no-cache del openssl; apk --no-cache del openssl; \
\
# Get rid of unused binaries
rm -f /usr/local/bin/gosu /usr/local/bin/su-exec;
VOLUME /mnt/data VOLUME /mnt/data

View file

@ -1,5 +1,5 @@
# syntax=docker/dockerfile:latest # 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 FROM redis:7.2.5-alpine
COPY --chmod=775 start.sh /start.sh COPY --chmod=775 start.sh /start.sh
@ -9,7 +9,10 @@ RUN set -ex; \
apk add --no-cache openssl bash; \ apk add --no-cache openssl bash; \
\ \
# Give root a random password # 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 -f /usr/local/bin/gosu;
USER redis USER redis
ENTRYPOINT ["/start.sh"] ENTRYPOINT ["/start.sh"]