Skip to content
Snippets Groups Projects
Commit 00bc903d authored by Nicolas Dandrimont's avatar Nicolas Dandrimont
Browse files

Install rust(up) in the bookworm-multipython image

parent 55d1056b
No related branches found
No related tags found
No related merge requests found
......@@ -177,6 +177,20 @@ RUN curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.s
ln -s opam-* opam && \
rm /tmp/opam-install
# Install rustup and the default rust toolchain
ENV CARGO_HOME="/home/${user}/.cargo"
ENV RUSTUP_HOME="/home/${user}/.rustup"
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o /tmp/rustup-init.sh && \
chmod +x /tmp/rustup-init.sh && \
/tmp/rustup-init.sh -y && \
rm /tmp/rustup-init.sh
ENV PATH="${CARGO_HOME}/bin:${PATH}"
COPY ./prepare-cargo-cache ${CARGO_HOME}/bin
# install rage (for swh-alter)
FROM rust:slim-bookworm as build_rage
......@@ -265,6 +279,8 @@ RUN pyenv global ${py37_version} ${py38_version} ${py39_version} ${py310_version
ENV SWH_PYTHON_FOR_GLOBAL_TOOLS python3.11
RUN mkdir /home/${user}/.cache
## vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv ##
# inlined from https://raw.githubusercontent.com/jenkinsci/docker-agent/4.13.3-2/11/bullseye/Dockerfile
#
......
#!/bin/bash
# Make sure cargo cache directories are properly moved to ~/.cache so they can
# stay around for subsequent runs
#
# See https://doc.rust-lang.org/nightly/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
set -ex
for dir in registry/index/ registry/cache/ git/db/; do
base="$(dirname $dir)"
mkdir -p "${HOME}/.cargo/$base"
mkdir -p "${HOME}/.cache/cargo/$dir"
rm -rf "${HOME}/.cargo/${dir#/}"
ln -s "${HOME}/.cache/cargo/$dir" "${HOME}/.cargo/$base/"
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment