Skip to content

The open-source app everyone uses to manage agents at work

refactor(docker): install rust via a verified rustup, pinned by rust-toolchain.toml (#12605)

Devin Foley317394456119
diff --git a/Dockerfile b/Dockerfile
index 92566cc3fe..6845aca095 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -52,9 +52,29 @@ RUN pnpm install --frozen-lockfile
FROM base AS build
WORKDIR /app
-RUN apt-get update \
- && apt-get install -y --no-install-recommends cargo rustc \
- && rm -rf /var/lib/apt/lists/*
+# Debian's packaged rust lags the ecosystem (trixie ships 1.85) and the
+# runner's dependency tree now requires a newer rustc. Install rustup from a
+# version-pinned, checksum-verified installer and let the runner's own
+# rust-toolchain.toml choose the compiler — one pin, owned by the runner
+# package, shared by CI and image builds alike.
+ENV RUSTUP_HOME=/usr/local/rustup \
+ CARGO_HOME=/usr/local/cargo \
+ PATH=/usr/local/cargo/bin:$PATH
+ARG RUSTUP_VERSION=1.29.0
+ARG RUSTUP_SHA256_AMD64=4acc9acc76d5079515b46346a485974457b5a79893cfb01112423c89aeb5aa10
+ARG RUSTUP_SHA256_ARM64=9732d6c5e2a098d3521fca8145d826ae0aaa067ef2385ead08e6feac88fa5792
+RUN set -eux; \
+ arch="$(dpkg --print-architecture)"; \
+ case "$arch" in \
+ amd64) rustTarget="x86_64-unknown-linux-gnu"; sha256="$RUSTUP_SHA256_AMD64" ;; \
+ arm64) rustTarget="aarch64-unknown-linux-gnu"; sha256="$RUSTUP_SHA256_ARM64" ;; \
+ *) echo "unsupported architecture: $arch" >&2; exit 1 ;; \
+ esac; \
+ curl -fsSLo /tmp/rustup-init "https://static.rust-lang.org/rustup/archive/${RUSTUP_VERSION}/${rustTarget}/rustup-init"; \
+ echo "${sha256} /tmp/rustup-init" | sha256sum -c -; \
+ chmod +x /tmp/rustup-init; \
+ /tmp/rustup-init -y --no-modify-path --profile minimal --default-toolchain none; \
+ rm /tmp/rustup-init
COPY --from=deps /app /app
COPY . .
RUN pnpm --filter @paperclipai/ui build