From 415e80804654d187a8119375fbc7e45886768eed Mon Sep 17 00:00:00 2001 From: konsti Date: Sun, 19 Nov 2023 09:12:51 +0100 Subject: [PATCH] Use pinned toolchain version in Dockerfile (#8763) The previous build would use the cached rust version instead of rust-toolchain.toml --- Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a6c2b7a82324b..018367b341a24 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,9 +16,12 @@ RUN case "$TARGETPLATFORM" in \ "linux/amd64") echo "x86_64-unknown-linux-musl" > rust_target.txt ;; \ *) exit 1 ;; \ esac -# TODO: --default-toolchain none and use rust-toolchain.toml instead -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --target $(cat rust_target.txt) --profile minimal +# Update rustup whenever we bump the rust version +COPY rust-toolchain.toml rust-toolchain.toml +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --target $(cat rust_target.txt) --profile minimal --default-toolchain none ENV PATH="$HOME/.cargo/bin:$PATH" +# Installs the correct toolchain version from rust-toolchain.toml and then the musl target +RUN rustup target add $(cat rust_target.txt) # Build COPY crates crates