From cfd2bac2aefebaffa6ee05639327812378df5543 Mon Sep 17 00:00:00 2001 From: Christbru Date: Sat, 18 Oct 2025 19:28:11 -0500 Subject: [PATCH] Rustup already installed --- rust-engine/Dockerfile | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/rust-engine/Dockerfile b/rust-engine/Dockerfile index bd77fab..0595ee6 100644 --- a/rust-engine/Dockerfile +++ b/rust-engine/Dockerfile @@ -14,18 +14,16 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ && rm -rf /var/lib/apt/lists/* + # Allow override of toolchain (stable, nightly, or a pinned version) ARG RUSTUP_TOOLCHAIN=stable -# Explicit HOME to avoid undefined variable during Docker build -ENV HOME=/root +# Use rustup and cargo from the official Rust image location +ENV PATH="/usr/local/cargo/bin:${PATH}" -# Install rustup and ensure the selected toolchain is installed (fixes edition mismatches in CI) -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \ - && /root/.cargo/bin/rustup toolchain install ${RUSTUP_TOOLCHAIN} \ - && /root/.cargo/bin/rustup default ${RUSTUP_TOOLCHAIN} - -ENV PATH="/root/.cargo/bin:${PATH}" +# Ensure the selected toolchain is installed and set as default (fixes edition mismatches in CI) +RUN /usr/local/cargo/bin/rustup toolchain install ${RUSTUP_TOOLCHAIN} \ + && /usr/local/cargo/bin/rustup default ${RUSTUP_TOOLCHAIN} # Copy manifest files first to leverage Docker layer caching for dependencies COPY Cargo.toml Cargo.lock ./