Skip to content

Commit cfd2427

Browse files
committed
Add cargo-zigbuild for release dockerfile (#4805)
* Add cargo-zigbuild for release dockerfile * address comments (cherry picked from commit 0af6e60)
1 parent f809cdd commit cfd2427

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

dev/release/Dockerfile

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,24 @@ FROM --platform=linux/amd64 maven:3.9.11-eclipse-temurin-17
2121
ARG DEBIAN_FRONTEND=noninteractive
2222
RUN apt-get update && \
2323
apt-get dist-upgrade -y && \
24-
apt-get install -y g++ cmake gnupg2 vim subversion less zip unzip
24+
apt-get install -y g++ cmake gnupg2 vim subversion less zip unzip xz-utils
25+
26+
# Rust toolchain (for native-io module's cargo-zigbuild build)
27+
ENV RUSTUP_HOME=/usr/local/rustup \
28+
CARGO_HOME=/usr/local/cargo \
29+
PATH=/usr/local/cargo/bin:$PATH
30+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
31+
sh -s -- -y --default-toolchain stable --profile minimal --no-modify-path && \
32+
rustup target add x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu && \
33+
chmod -R a+rwX /usr/local/rustup /usr/local/cargo
34+
35+
# Zig (used by cargo-zigbuild for cross-compilation)
36+
ARG ZIG_VERSION=0.13.0
37+
RUN curl -sL https://ziglang.org/download/${ZIG_VERSION}/zig-linux-x86_64-${ZIG_VERSION}.tar.xz | \
38+
tar -xJ -C /opt && \
39+
ln -s /opt/zig-linux-x86_64-${ZIG_VERSION}/zig /usr/local/bin/zig
40+
41+
# cargo-zigbuild
42+
RUN cargo install cargo-zigbuild --locked && \
43+
chmod -R a+rwX /usr/local/cargo
2544

0 commit comments

Comments
 (0)