@@ -52,6 +52,8 @@ RUN apt-get update --fix-missing && TZ=UTC DEBIAN_FRONTEND=noninteractive apt-ge
5252 python3-setuptools \
5353 xz-utils \
5454 zstd \
55+ # TODO(parkmycar): Include libclang in our Bazel sysroot.
56+ libclang-18-dev \
5557 && rm -rf /var/lib/apt/lists/*
5658
5759# Install Python dependencies. These are necessary to run some of our base tooling.
@@ -61,7 +63,14 @@ RUN curl -LsSf https://astral.sh/uv/0.4.25/install.sh | UV_INSTALL_DIR=/usr/loca
6163
6264# Install extra tools not available in apt repositories.
6365
66+ COPY rust.asc .
67+ RUN gpg --import rust.asc \
68+ && rm rust.asc \
69+ && echo "trusted-key 85AB96E6FA1BE5FE" >> ~/.gnupg/gpg.conf
70+
6471ARG BAZEL_VERSION
72+ ARG RUST_DATE
73+ ARG RUST_VERSION
6574
6675RUN \
6776 # 1. autouseradd
8594 && curl -fsSL https://github.com/docker/compose/releases/download/v2.15.1/docker-compose-linux-$ARCH_GCC > /usr/local/lib/docker/cli-plugins/docker-compose \
8695 && chmod +x /usr/local/lib/docker/cli-plugins/docker-compose \
8796 && curl -fsSL https://github.com/christian-korneck/docker-pushrm/releases/download/v1.9.0/docker-pushrm_linux_$ARCH_GO > /usr/local/lib/docker/cli-plugins/docker-pushrm \
88- && chmod +x /usr/local/lib/docker/cli-plugins/docker-pushrm
97+ && chmod +x /usr/local/lib/docker/cli-plugins/docker-pushrm \
98+ # 4. Cargo
99+ #
100+ # Some parts of our stack use 'cargo' to read metadata, so we install just that. Importantly we
101+ # do not install 'rustc' or any of the other tools, this keeps the Docker image small.
102+ && mkdir rust \
103+ && curl -fsSL https://static.rust-lang.org/dist$RUST_DATE/rust-$RUST_VERSION-$ARCH_GCC-unknown-linux-gnu.tar.gz > rust.tar.gz \
104+ && curl -fsSL https://static.rust-lang.org/dist$RUST_DATE/rust-$RUST_VERSION-$ARCH_GCC-unknown-linux-gnu.tar.gz.asc > rust.asc \
105+ && gpg --verify rust.asc rust.tar.gz \
106+ && tar -xzf rust.tar.gz -C rust --strip-components=1 \
107+ && rust/install.sh --components=cargo \
108+ && rm -rf rust.asc rust.tar.gz rust
89109
90110# Make the image as small as possible.
91111RUN find /workdir /root -mindepth 1 -maxdepth 1 -exec rm -rf {} +
0 commit comments