diff --git a/Dockerfile b/Dockerfile index e466e3ef..8be39890 100644 --- a/Dockerfile +++ b/Dockerfile @@ -302,8 +302,8 @@ FROM moul/protoc-gen-gotemplate:v${PROTOC_GEN_GOTEMPLATE_VERSION} as protoc_gen_ FROM --platform=$BUILDPLATFORM alpine_host as upx RUN mkdir -p /upx ARG BUILDARCH BUILDOS UPX_VERSION -RUN curl -sSL https://github.com/upx/upx/releases/download/v${UPX_VERSION}/upx-${UPX_VERSION}-${BUILDARCH}_${BUILDOS}.tar.xz | tar xJ --strip 1 -C /upx -RUN install -D /upx/upx /usr/local/bin/upx +RUN if ! [ "${TARGETARCH}" = "arm64" ]; then curl -sSL https://github.com/upx/upx/releases/download/v${UPX_VERSION}/upx-${UPX_VERSION}-${BUILDARCH}_${BUILDOS}.tar.xz | tar xJ --strip 1 -C /upx; fi +RUN if ! [ "${TARGETARCH}" = "arm64" ]; then install -D /upx/upx /usr/local/bin/upx; fi COPY --from=googleapis /out/ /out/ COPY --from=grpc_swift /protoc-gen-swift /out/protoc-gen-swift COPY --from=grpc_gateway /out/ /out/ @@ -320,10 +320,15 @@ COPY --from=protoc_gen_jsonschema /out/ /out/ COPY --from=protoc_gen_lint /out/ /out/ COPY --from=protoc_gen_rust /out/ /out/ COPY --from=protoc_gen_validate /out/ /out/ -RUN upx --lzma $(find /out/usr/bin/ \ - -type f -name 'grpc_*' \ - -or -name 'protoc-gen-*' \ - ) +ARG TARGETARCH +RUN <