From 7a8795883bb96836102dd47b0b845065c7e8294f Mon Sep 17 00:00:00 2001 From: bunkerity Date: Wed, 21 Oct 2020 15:12:27 +0200 Subject: [PATCH] dockerfile fix - compile --- Dockerfile | 5 +---- Dockerfile-amd64 | 5 +---- Dockerfile-arm32v7 | 10 +++------- Dockerfile-arm64v8 | 10 +++------- Dockerfile-i386 | 5 +---- compile.sh | 2 +- 6 files changed, 10 insertions(+), 27 deletions(-) diff --git a/Dockerfile b/Dockerfile index 13f46fa..5f53f19 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM nginx:stable-alpine AS builder +FROM nginx:stable-alpine COPY nginx-keys/ /tmp/nginx-keys COPY compile.sh /tmp/compile.sh @@ -6,9 +6,6 @@ RUN chmod +x /tmp/compile.sh && \ /tmp/compile.sh && \ rm -rf /tmp/* -FROM nginx:stable-alpine - -COPY --from=builder /*.so /usr/local/nginx/modules/ COPY entrypoint.sh /opt/entrypoint.sh COPY confs/ /opt/confs COPY scripts/ /opt/scripts diff --git a/Dockerfile-amd64 b/Dockerfile-amd64 index a3f0d6a..4734e71 100644 --- a/Dockerfile-amd64 +++ b/Dockerfile-amd64 @@ -1,4 +1,4 @@ -FROM amd64/nginx:stable-alpine AS builder +FROM amd64/nginx:stable-alpine COPY nginx-keys/ /tmp/nginx-keys COPY compile.sh /tmp/compile.sh @@ -6,9 +6,6 @@ RUN chmod +x /tmp/compile.sh && \ /tmp/compile.sh && \ rm -rf /tmp/* -FROM amd64/nginx:stable-alpine - -COPY --from=builder /*.so /usr/local/nginx/modules/ COPY entrypoint.sh /opt/entrypoint.sh COPY confs/ /opt/confs COPY scripts/ /opt/scripts diff --git a/Dockerfile-arm32v7 b/Dockerfile-arm32v7 index dd7fc61..766a494 100644 --- a/Dockerfile-arm32v7 +++ b/Dockerfile-arm32v7 @@ -1,11 +1,11 @@ -FROM alpine AS builder1 +FROM alpine AS builder ENV QEMU_URL https://github.com/balena-io/qemu/releases/download/v4.0.0%2Bbalena2/qemu-4.0.0.balena2-arm.tar.gz RUN apk add curl && curl -L ${QEMU_URL} | tar zxvf - -C . --strip-components 1 -FROM arm32v7/nginx:stable-alpine AS builder2 +FROM arm32v7/nginx:stable-alpine -COPY --from=builder1 qemu-arm-static /usr/bin +COPY --from=builder qemu-arm-static /usr/bin COPY nginx-keys/ /tmp/nginx-keys COPY compile.sh /tmp/compile.sh @@ -13,10 +13,6 @@ RUN chmod +x /tmp/compile.sh && \ /tmp/compile.sh && \ rm -rf /tmp/* -FROM arm32v7/nginx:stable-alpine - -COPY --from=builder1 qemu-arm-static /usr/bin -COPY --from=builder2 /*.so /usr/local/nginx/modules/ COPY entrypoint.sh /opt/entrypoint.sh COPY confs/ /opt/confs COPY scripts/ /opt/scripts diff --git a/Dockerfile-arm64v8 b/Dockerfile-arm64v8 index 5328ec9..b8ad12b 100644 --- a/Dockerfile-arm64v8 +++ b/Dockerfile-arm64v8 @@ -1,11 +1,11 @@ -FROM alpine AS builder1 +FROM alpine AS builder ENV QEMU_URL https://github.com/balena-io/qemu/releases/download/v4.0.0%2Bbalena2/qemu-4.0.0.balena2-aarch64.tar.gz RUN apk add curl && curl -L ${QEMU_URL} | tar zxvf - -C . --strip-components 1 -FROM arm64v8/nginx:stable-alpine AS builder2 +FROM arm64v8/nginx:stable-alpine -COPY --from=builder1 qemu-aarch64-static /usr/bin +COPY --from=builder qemu-aarch64-static /usr/bin COPY nginx-keys/ /tmp/nginx-keys COPY compile.sh /tmp/compile.sh @@ -13,10 +13,6 @@ RUN chmod +x /tmp/compile.sh && \ /tmp/compile.sh && \ rm -rf /tmp/* -FROM arm64v8/nginx:stable-alpine - -COPY --from=builder1 qemu-aarch64-static /usr/bin -COPY --from=builder2 /*.so /usr/local/nginx/modules/ COPY entrypoint.sh /opt/entrypoint.sh COPY confs/ /opt/confs COPY scripts/ /opt/scripts diff --git a/Dockerfile-i386 b/Dockerfile-i386 index 13b0857..2bdd9e0 100644 --- a/Dockerfile-i386 +++ b/Dockerfile-i386 @@ -1,4 +1,4 @@ -FROM i386/nginx:stable-alpine AS builder +FROM i386/nginx:stable-alpine COPY nginx-keys/ /tmp/nginx-keys COPY compile.sh /tmp/compile.sh @@ -6,9 +6,6 @@ RUN chmod +x /tmp/compile.sh && \ /tmp/compile.sh && \ rm -rf /tmp/* -FROM i386/nginx:stable-alpine - -COPY --from=builder /*.so /usr/local/nginx/modules/ COPY entrypoint.sh /opt/entrypoint.sh COPY confs/ /opt/confs COPY scripts/ /opt/scripts diff --git a/compile.sh b/compile.sh index c6c0c7b..cadc7cf 100644 --- a/compile.sh +++ b/compile.sh @@ -122,7 +122,7 @@ CONFARGS=$(nginx -V 2>&1 | sed -n -e 's/^.*arguments: //p') CONFARGS=${CONFARGS/-Os -fomit-frame-pointer/-Os} ./configure $CONFARGS --add-dynamic-module=/tmp/ModSecurity-nginx --add-dynamic-module=/tmp/headers-more-nginx-module --add-dynamic-module=/tmp/ngx_http_geoip2_module --add-dynamic-module=/tmp/nginx_cookie_flag_module --add-dynamic-module=/tmp/lua-nginx-module make -j $NTASK modules -cp ./objs/*.so / +cp ./objs/*.so /usr/local/nginx/modules/ # remove build dependencies apk del build