Commit d1427ac5 authored by Anant Sharma's avatar Anant Sharma Committed by GitHub
Browse files

fix: use rustup-init for rust install (#319)

parent 43ff14ce
...@@ -58,11 +58,25 @@ RUN ln -sf /bin/bash /bin/sh ...@@ -58,11 +58,25 @@ RUN ln -sf /bin/bash /bin/sh
# Rust build/dev dependencies # Rust build/dev dependencies
RUN apt-get update && \ RUN apt-get update && \
apt-get install --no-install-recommends --yes gdb protobuf-compiler cmake libssl-dev pkg-config apt-get install --no-install-recommends -y \
gdb \
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y protobuf-compiler \
ENV PATH="/root/.cargo/bin:${PATH}" cmake \
RUN rustup toolchain install 1.85.0-x86_64-unknown-linux-gnu libssl-dev \
pkg-config
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH \
RUST_VERSION=1.85.0 \
RUSTARCH=x86_64-unknown-linux-gnu
RUN wget --tries=3 --waitretry=5 "https://static.rust-lang.org/rustup/archive/1.28.1/${RUSTARCH}/rustup-init" && \
echo "a3339fb004c3d0bb9862ba0bce001861fe5cbde9c10d16591eb3f39ee6cd3e7f *rustup-init" | sha256sum -c - && \
chmod +x rustup-init && \
./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${RUSTARCH} && \
rm rustup-init && \
chmod -R a+w $RUSTUP_HOME $CARGO_HOME
# Working directory # Working directory
WORKDIR /workspace WORKDIR /workspace
......
...@@ -226,15 +226,25 @@ RUN ln -sf /bin/bash /bin/sh ...@@ -226,15 +226,25 @@ RUN ln -sf /bin/bash /bin/sh
# Rust build/dev dependencies # Rust build/dev dependencies
RUN apt update -y && \ RUN apt update -y && \
apt install -y \ apt install --no-install-recommends -y \
build-essential \ build-essential \
protobuf-compiler \ protobuf-compiler \
cmake \ cmake \
libssl-dev \ libssl-dev \
pkg-config && \ pkg-config
curl https://sh.rustup.rs -sSf | bash -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}" ENV RUSTUP_HOME=/usr/local/rustup \
RUN rustup toolchain install 1.85.0-x86_64-unknown-linux-gnu CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH \
RUST_VERSION=1.85.0 \
RUSTARCH=x86_64-unknown-linux-gnu
RUN wget --tries=3 --waitretry=5 "https://static.rust-lang.org/rustup/archive/1.28.1/${RUSTARCH}/rustup-init" && \
echo "a3339fb004c3d0bb9862ba0bce001861fe5cbde9c10d16591eb3f39ee6cd3e7f *rustup-init" | sha256sum -c - && \
chmod +x rustup-init && \
./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${RUSTARCH} && \
rm rustup-init && \
chmod -R a+w $RUSTUP_HOME $CARGO_HOME
# Working directory # Working directory
WORKDIR /workspace WORKDIR /workspace
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment