FROM --platform=$BUILDPLATFORM ubuntu AS build ENV HOME="/root" WORKDIR $HOME RUN apt update \ && apt install -y --no-install-recommends \ build-essential \ curl \ python3-venv \ && apt clean \ && rm -rf /var/lib/apt/lists/* # Setup zig as cross compiling linker RUN python3 -m venv $HOME/.venv RUN .venv/bin/pip install cargo-zigbuild ENV PATH="$HOME/.venv/bin:$PATH" # Install rust ARG TARGETPLATFORM RUN case "$TARGETPLATFORM" in \ "linux/arm64") echo "aarch64-unknown-linux-musl" > rust_target.txt ;; \ "linux/amd64") echo "x86_64-unknown-linux-musl" > rust_target.txt ;; \ *) exit 1 ;; \ esac # Temporarily using nightly-2025-11-02 for bundled musl v1.2.5 # Ref: https://github.com/rust-lang/rust/pull/142682 # TODO(samypr100): Remove when toolchain updates to 1.93 COPY <