diff --git a/Dockerfile-arm32v7 b/Dockerfile-arm32v7 index f9414b3..737c325 100644 --- a/Dockerfile-arm32v7 +++ b/Dockerfile-arm32v7 @@ -1,8 +1,12 @@ -FROM arm32v7/nginx:stable-alpine AS builder +FROM alpine AS builder1 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 + +COPY --from=builder1 qemu-arm-static /usr/bin + COPY compile.sh /tmp/compile.sh RUN chmod +x /tmp/compile.sh && \ /tmp/compile.sh && \ @@ -10,8 +14,8 @@ RUN chmod +x /tmp/compile.sh && \ FROM arm32v7/nginx:stable-alpine -COPY --from=builder qemu-arm-static /usr/bin -COPY --from=builder /*.so /usr/local/nginx/modules/ +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 36a73ef..23e7541 100644 --- a/Dockerfile-arm64v8 +++ b/Dockerfile-arm64v8 @@ -1,8 +1,12 @@ -FROM arm64v8/nginx:stable-alpine AS builder +FROM alpine AS builder1 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 + +COPY --from=builder1 qemu-aarch64-static /usr/bin + COPY compile.sh /tmp/compile.sh RUN chmod +x /tmp/compile.sh && \ /tmp/compile.sh && \ @@ -10,8 +14,8 @@ RUN chmod +x /tmp/compile.sh && \ FROM arm64v8/nginx:stable-alpine -COPY --from=builder qemu-aarch64-static /usr/bin -COPY --from=builder /*.so /usr/local/nginx/modules/ +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