use light variant of hardened malloc

Much lower memory usage, remains security-focused
This commit is contained in:
Wonderfall 2022-01-13 22:58:55 +01:00 committed by hoellen
parent beab287fc4
commit d3bfe95eb4

View File

@ -77,12 +77,13 @@ FROM alpine:${ALPINE_VERSION} as build-malloc
ARG HARDENED_MALLOC_VERSION ARG HARDENED_MALLOC_VERSION
ARG CONFIG_NATIVE=false ARG CONFIG_NATIVE=false
ARG VARIANT=light
RUN apk --no-cache add build-base git gnupg && cd /tmp \ RUN apk --no-cache add build-base git gnupg && cd /tmp \
&& wget -q https://github.com/thestinger.gpg && gpg --import thestinger.gpg \ && wget -q https://github.com/thestinger.gpg && gpg --import thestinger.gpg \
&& git clone --depth 1 --branch ${HARDENED_MALLOC_VERSION} https://github.com/GrapheneOS/hardened_malloc \ && git clone --depth 1 --branch ${HARDENED_MALLOC_VERSION} https://github.com/GrapheneOS/hardened_malloc \
&& cd hardened_malloc && git verify-tag $(git describe --tags) \ && cd hardened_malloc && git verify-tag $(git describe --tags) \
&& make CONFIG_NATIVE=${CONFIG_NATIVE} && make CONFIG_NATIVE=${CONFIG_NATIVE} VARIANT=${VARIANT}
### Fetch nginx ### Fetch nginx
@ -94,7 +95,7 @@ FROM base as nextcloud
COPY --from=nginx /usr/sbin/nginx /usr/sbin/nginx COPY --from=nginx /usr/sbin/nginx /usr/sbin/nginx
COPY --from=nginx /etc/nginx /etc/nginx COPY --from=nginx /etc/nginx /etc/nginx
COPY --from=build-malloc /tmp/hardened_malloc/out/libhardened_malloc.so /usr/local/lib/ COPY --from=build-malloc /tmp/hardened_malloc/out-light/libhardened_malloc-light.so /usr/local/lib/
ARG NEXTCLOUD_VERSION ARG NEXTCLOUD_VERSION
ARG GPG_nextcloud="2880 6A87 8AE4 23A2 8372 792E D758 99B9 A724 937A" ARG GPG_nextcloud="2880 6A87 8AE4 23A2 8372 792E D758 99B9 A724 937A"
@ -110,7 +111,7 @@ ENV UPLOAD_MAX_SIZE=10G \
CRON_MEMORY_LIMIT=1g \ CRON_MEMORY_LIMIT=1g \
DB_TYPE=sqlite3 \ DB_TYPE=sqlite3 \
DOMAIN=localhost \ DOMAIN=localhost \
LD_PRELOAD="/usr/local/lib/libhardened_malloc.so /usr/lib/preloadable_libiconv.so" LD_PRELOAD="/usr/local/lib/libhardened_malloc-light.so /usr/lib/preloadable_libiconv.so"
RUN apk --no-cache add \ RUN apk --no-cache add \
gnupg \ gnupg \