Skip to content

Commit

Permalink
fix: make devcontainer standalone for rust toolchain version (starkwa…
Browse files Browse the repository at this point in the history
  • Loading branch information
glihm authored Jan 10, 2024
1 parent 3bb35a6 commit 136a67a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \

RUN apt install -y gh libgmp3-dev

COPY rust-toolchain.toml .
# To allow independent workflow of the container, the rust-toolchain is explicitely given.
RUN echo "1.74.0" > rust_toolchain_version

# Install cargo-binstall
RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash

RUN rustup toolchain install $(cat rust-toolchain.toml | grep channel | cut -d\" -f2) && \
rustup default $(cat rust-toolchain.toml | grep channel | cut -d\" -f2) && \
RUN rustup toolchain install $(cat rust_toolchain_version) && \
rustup default $(cat rust_toolchain_version) && \
rustup component add clippy && \
rustup component add rustfmt

Expand All @@ -37,14 +38,14 @@ RUN if [ "$TARGETPLATFORM" = "linux/arm64" ] ; then \
mv hurl-4.1.0-aarch64-unknown-linux-gnu/hurl /usr/local/bin/ && \
rm -r hurl-4.1.0-aarch64-unknown-linux-gnu && \
rm hurl.tar.gz && \
rustup component add llvm-tools-preview --toolchain 1.70.0-aarch64-unknown-linux-gnu; \
rustup component add llvm-tools-preview --toolchain $(cat rust_toolchain_version)-aarch64-unknown-linux-gnu; \
elif [ "$TARGETPLATFORM" = "linux/amd64" ] ; then \
curl -L https://github.com/Orange-OpenSource/hurl/releases/download/4.1.0/hurl-4.1.0-x86_64-unknown-linux-gnu.tar.gz -o hurl.tar.gz && \
tar -xzf hurl.tar.gz && \
mv hurl-4.1.0-x86_64-unknown-linux-gnu/hurl /usr/local/bin/ && \
rm -r hurl-4.1.0-x86_64-unknown-linux-gnu && \
rm hurl.tar.gz && \
rustup component add llvm-tools-preview --toolchain 1.70.0-x86_64-unknown-linux-gnu && \
rustup component add llvm-tools-preview --toolchain $(cat rust_toolchain_version)-x86_64-unknown-linux-gnu && \
rustup target add x86_64-fortanix-unknown-sgx --toolchain nightly; \
fi

Expand Down

0 comments on commit 136a67a

Please sign in to comment.