Skip to content

Commit

Permalink
Add rcodesign installation to golang-builder
Browse files Browse the repository at this point in the history
Signed-off-by: Alper Polat <[email protected]>

Install rust and rcodesign

This method was chosen because rust shipped with debian is 1.63.0,
which does not seem to be sufficient for the binary to be built.
So, we have to install rust from source.

Signed-off-by: Alper Polat <[email protected]>

Move rust installation further down for better flow

Seems like build pipeline fails because we remove the osxcross
directory, so might be better to concatenate the path and install
rust a bit later.

Signed-off-by: Alper Polat <[email protected]>

Use rust image to add rcodesign instead of rustup

Signed-off-by: Alper Polat <[email protected]>

Copy from the correct directory

Seems like the rcodesign binary ended up in `/usr/local/cargo`
not /root...
Signed-off-by: Alper Polat <[email protected]>

Use `/usr/local/bin` instead

Keep it simpler, we don't need the `cargo` directory.
Signed-off-by: Alper Polat <[email protected]>

Remove redundant space

Signed-off-by: Alper Polat <[email protected]>
  • Loading branch information
gitperr committed Feb 5, 2024
1 parent 80439d9 commit 0118df7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions 1.20/main/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>

Expand All @@ -22,10 +26,12 @@ RUN \
crossbuild-essential-powerpc linux-libc-dev-powerpc-cross \
crossbuild-essential-ppc64el linux-libc-dev-ppc64el-cross \
crossbuild-essential-s390x linux-libc-dev-s390x-cross \
gcc-riscv64-linux-gnu g++-riscv64-linux-gnu libc6-dev-riscv64-cross\
libc6-riscv64-cross linux-libc-dev-riscv64-cross\
gcc-riscv64-linux-gnu g++-riscv64-linux-gnu libc6-dev-riscv64-cross \
libc6-riscv64-cross linux-libc-dev-riscv64-cross \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /tmp/osxcross

COPY --from=rustbuilder /usr/local/cargo/bin/rcodesign /usr/local/bin/rcodesign

ARG PROM_OSX_SDK_URL
ENV OSXCROSS_PATH=/usr/osxcross \
Expand Down
10 changes: 8 additions & 2 deletions 1.21/main/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>

Expand All @@ -22,10 +26,12 @@ RUN \
crossbuild-essential-powerpc linux-libc-dev-powerpc-cross \
crossbuild-essential-ppc64el linux-libc-dev-ppc64el-cross \
crossbuild-essential-s390x linux-libc-dev-s390x-cross \
gcc-riscv64-linux-gnu g++-riscv64-linux-gnu libc6-dev-riscv64-cross\
libc6-riscv64-cross linux-libc-dev-riscv64-cross\
gcc-riscv64-linux-gnu g++-riscv64-linux-gnu libc6-dev-riscv64-cross \
libc6-riscv64-cross linux-libc-dev-riscv64-cross \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /tmp/osxcross

COPY --from=rustbuilder /usr/local/cargo/bin/rcodesign /usr/local/bin/rcodesign

ARG PROM_OSX_SDK_URL
ENV OSXCROSS_PATH=/usr/osxcross \
Expand Down

0 comments on commit 0118df7

Please sign in to comment.