Rustup already installed
This commit is contained in:
parent
fc3e2b92e9
commit
cfd2bac2ae
1 changed files with 6 additions and 8 deletions
|
|
@ -14,18 +14,16 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
|
||||||
# Allow override of toolchain (stable, nightly, or a pinned version)
|
# Allow override of toolchain (stable, nightly, or a pinned version)
|
||||||
ARG RUSTUP_TOOLCHAIN=stable
|
ARG RUSTUP_TOOLCHAIN=stable
|
||||||
|
|
||||||
# Explicit HOME to avoid undefined variable during Docker build
|
# Use rustup and cargo from the official Rust image location
|
||||||
ENV HOME=/root
|
ENV PATH="/usr/local/cargo/bin:${PATH}"
|
||||||
|
|
||||||
# Install rustup and ensure the selected toolchain is installed (fixes edition mismatches in CI)
|
# Ensure the selected toolchain is installed and set as default (fixes edition mismatches in CI)
|
||||||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
|
RUN /usr/local/cargo/bin/rustup toolchain install ${RUSTUP_TOOLCHAIN} \
|
||||||
&& /root/.cargo/bin/rustup toolchain install ${RUSTUP_TOOLCHAIN} \
|
&& /usr/local/cargo/bin/rustup default ${RUSTUP_TOOLCHAIN}
|
||||||
&& /root/.cargo/bin/rustup default ${RUSTUP_TOOLCHAIN}
|
|
||||||
|
|
||||||
ENV PATH="/root/.cargo/bin:${PATH}"
|
|
||||||
|
|
||||||
# Copy manifest files first to leverage Docker layer caching for dependencies
|
# Copy manifest files first to leverage Docker layer caching for dependencies
|
||||||
COPY Cargo.toml Cargo.lock ./
|
COPY Cargo.toml Cargo.lock ./
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue