Skip to content

Commit ae954d5

Browse files
authored
build: add rust toolchain to build container (#409)
This enables building rust libraries within the build container.
1 parent 8e0f38e commit ae954d5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

build-tools/final/Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ FROM $libbpf_IMAGE_TAG as build-libbpf
2424
# Bring everything together
2525
FROM build-main AS build-result
2626

27+
ARG RUST_TOOLCHAIN=stable
28+
2729
# Package definitions
2830
# Include fuse-overlayfs so rootless podman can run on overlayfs (e.g., in containers)
2931
ARG PKG_DOCKER="podman uidmap fuse-overlayfs"
@@ -85,6 +87,12 @@ RUN sudo wget \
8587
https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.12/swagger-codegen-cli-2.4.12.jar \
8688
-O /usr/local/lib/swagger-codegen-cli.jar
8789

90+
# Rust toolchain for building Rust components
91+
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain ${RUST_TOOLCHAIN} && \
92+
. "$HOME/.cargo/env" && \
93+
rustup component add rustfmt clippy
94+
ENV PATH="${HOME}/.cargo/bin:${PATH}"
95+
8896
# Preprocessor for BPF used by cmake
8997
RUN pip3 install --break-system-packages pcpp
9098

0 commit comments

Comments
 (0)