Skip to content

Commit

Permalink
Custom rust installation
Browse files Browse the repository at this point in the history
  • Loading branch information
axonasif committed Oct 13, 2023
1 parent dcf235e commit 586bc22
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM gitpod/workspace-rust:2023-10-13-07-50-14
FROM gitpod/workspace-base:2023-10-13-07-50-14

USER root

Expand All @@ -10,6 +10,18 @@ RUN target=/usr/bin/meilisearch \

USER gitpod

RUN rustup default nightly-2023-10-12 \
&& rustup component add clippy --toolchain nightly-2023-10-12 \
&& rustup component add rustfmt --toolchain nightly-2023-10-12
ENV RUST_VERSION="nightly-2023-10-12"
ENV PATH=$HOME/.cargo/bin:$PATH

RUN curl -fsSL https://sh.rustup.rs | sh -s -- -y --no-modify-path --default-toolchain ${RUST_VERSION} \
-c rls rust-analysis rust-src rustfmt clippy \
&& for cmp in rustup cargo; do rustup completions bash "$cmp" > "$HOME/.local/share/bash-completion/completions/$cmp"; done \
&& printf '%s\n' 'export CARGO_HOME=/workspace/.cargo' \
'mkdir -m 0755 -p "$CARGO_HOME/bin" 2>/dev/null' \
'export PATH=$CARGO_HOME/bin:$PATH' \
'test ! -e "$CARGO_HOME/bin/rustup" && mv "$(command -v rustup)" "$CARGO_HOME/bin"' > $HOME/.bashrc.d/80-rust \
&& rm -rf "$HOME/.cargo/registry" # This registry cache is now useless as we change the CARGO_HOME path to `/workspace`

RUN rustup default ${RUST_VERSION} # not needed but anyway \
&& rustup component add clippy \
&& rustup component add rustfmt

0 comments on commit 586bc22

Please sign in to comment.