Skip to content

Commit

Permalink
Install rust and rcodesign
Browse files Browse the repository at this point in the history
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 <gitperr@gmail.com>
  • Loading branch information
gitperr committed Jan 28, 2024
1 parent 2e95735 commit 4750abf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
9 changes: 6 additions & 3 deletions 1.20/main/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ RUN \
libc6-riscv64-cross linux-libc-dev-riscv64-cross \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /tmp/osxcross \
&& cargo install --git https://github.com/indygreg/apple-platform-rs --branch main --bin rcodesign apple-codesign
&& curl https://sh.rustup.rs -sSf | sh -s -- -y


ARG PROM_OSX_SDK_URL
ENV OSXCROSS_PATH=/usr/osxcross \
OSXCROSS_REV=ff8d100f3f026b4ffbe4ce96d8aac4ce06f1278b \
SDK_VERSION=14 \
DARWIN_VERSION=23 \
OSX_VERSION_MIN=10.13
OSX_VERSION_MIN=10.13 \
PATH="/root/.cargo/bin:${PATH}"

WORKDIR /tmp/osxcross
RUN \
Expand All @@ -42,7 +44,8 @@ RUN \
&& curl -s -f -L "${PROM_OSX_SDK_URL}/MacOSX${SDK_VERSION}.sdk.tar.xz" -o "tarballs/MacOSX${SDK_VERSION}.sdk.tar.xz" \
&& UNATTENDED=yes JOBS=2 ./build.sh \
&& mv target "${OSXCROSS_PATH}" \
&& rm -rf /tmp/osxcross "/usr/osxcross/SDK/MacOSX${SDK_VERSION}.sdk/usr/share/man"
&& rm -rf /tmp/osxcross "/usr/osxcross/SDK/MacOSX${SDK_VERSION}.sdk/usr/share/man" \
&& cargo install --git https://github.com/indygreg/apple-platform-rs --branch main --bin rcodesign apple-codesign

WORKDIR /app

Expand Down
11 changes: 7 additions & 4 deletions 1.21/main/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ MAINTAINER The Prometheus Authors <prometheus-developers@googlegroups.com>
RUN \
apt-get update && apt-get install -y --no-install-recommends \
clang \
cmake \
cmake \
libc6-dev \
libxml2-dev \
lzma-dev \
Expand All @@ -26,14 +26,16 @@ RUN \
libc6-riscv64-cross linux-libc-dev-riscv64-cross \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /tmp/osxcross \
&& cargo install --git https://github.com/indygreg/apple-platform-rs --branch main --bin rcodesign apple-codesign
# Install rust separately, because debian bookworm does not ship newer than 1.63.0
&& curl https://sh.rustup.rs -sSf | sh -s -- -y

ARG PROM_OSX_SDK_URL
ENV OSXCROSS_PATH=/usr/osxcross \
OSXCROSS_REV=ff8d100f3f026b4ffbe4ce96d8aac4ce06f1278b \
SDK_VERSION=14 \
DARWIN_VERSION=23 \
OSX_VERSION_MIN=10.13
OSX_VERSION_MIN=10.13 \
PATH="/root/.cargo/bin:${PATH}"

WORKDIR /tmp/osxcross
RUN \
Expand All @@ -42,7 +44,8 @@ RUN \
&& curl -s -f -L "${PROM_OSX_SDK_URL}/MacOSX${SDK_VERSION}.sdk.tar.xz" -o "tarballs/MacOSX${SDK_VERSION}.sdk.tar.xz" \
&& UNATTENDED=yes JOBS=2 ./build.sh \
&& mv target "${OSXCROSS_PATH}" \
&& rm -rf /tmp/osxcross "/usr/osxcross/SDK/MacOSX${SDK_VERSION}.sdk/usr/share/man"
&& rm -rf /tmp/osxcross "/usr/osxcross/SDK/MacOSX${SDK_VERSION}.sdk/usr/share/man" \
&& cargo install --git https://github.com/indygreg/apple-platform-rs --branch main --bin rcodesign apple-codesign

WORKDIR /app

Expand Down

0 comments on commit 4750abf

Please sign in to comment.