diff --git a/1.20/main/Dockerfile b/1.20/main/Dockerfile index afdc8d0..ec3d3c7 100644 --- a/1.20/main/Dockerfile +++ b/1.20/main/Dockerfile @@ -1,3 +1,7 @@ +FROM rust:latest as rustbuilder + +RUN cargo install --git https://github.com/indygreg/apple-platform-rs --branch main --bin rcodesign apple-codesign + FROM quay.io/prometheus/golang-builder:1.20-base MAINTAINER The Prometheus Authors @@ -26,8 +30,9 @@ RUN \ libc6-riscv64-cross linux-libc-dev-riscv64-cross \ && rm -rf /var/lib/apt/lists/* \ && mkdir -p /tmp/osxcross \ - && curl https://sh.rustup.rs -sSf | sh -s -- -y + && mkdir -p /root/.cargo +COPY --from=rustbuilder /root/.cargo/bin /root/.cargo/bin ARG PROM_OSX_SDK_URL ENV OSXCROSS_PATH=/usr/osxcross \ diff --git a/1.21/main/Dockerfile b/1.21/main/Dockerfile index 728a75a..6f3d099 100644 --- a/1.21/main/Dockerfile +++ b/1.21/main/Dockerfile @@ -1,3 +1,7 @@ +FROM rust:latest as rustbuilder + +RUN cargo install --git https://github.com/indygreg/apple-platform-rs --branch main --bin rcodesign apple-codesign + FROM quay.io/prometheus/golang-builder:1.21-base MAINTAINER The Prometheus Authors @@ -26,8 +30,9 @@ RUN \ libc6-riscv64-cross linux-libc-dev-riscv64-cross \ && rm -rf /var/lib/apt/lists/* \ && mkdir -p /tmp/osxcross \ - # Install rust separately, because debian bookworm does not ship newer than 1.63.0 - && curl https://sh.rustup.rs -sSf | sh -s -- -y + && mkdir -p /root/.cargo + +COPY --from=rustbuilder /root/.cargo/bin /root/.cargo/bin ARG PROM_OSX_SDK_URL ENV OSXCROSS_PATH=/usr/osxcross \ @@ -49,6 +54,4 @@ WORKDIR /app ENV PATH /root/.cargo/bin:$OSXCROSS_PATH/bin:$PATH -RUN cargo install --git https://github.com/indygreg/apple-platform-rs --branch main --bin rcodesign apple-codesign - COPY rootfs /