Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions scripts/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,20 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
&& rustc --version \
&& cargo --version

# Relocate cargo's caches onto the runner's persistent volume (mounted at
# /home/runner/runner) for runtime. The toolchain binaries stay baked in
# the image at /usr/local/cargo/bin (still first on PATH, set above) and
# rustup resolves toolchains via RUSTUP_HOME — only the registry/git
# cache (CARGO_HOME) and compiled artifacts (CARGO_TARGET_DIR) move.
#
# Why this matters: workflows run `actions/checkout`, which `git clean`s
# the checkout's `target/` every run. With these dirs OUTSIDE the checkout
# (siblings of `_work` on the same volume), build output survives both the
# git-clean and container recreation — so CI stays warm without uploading
# a cache to GitHub's cloud on every run.
ENV CARGO_HOME=/home/runner/runner/cargo-home \
CARGO_TARGET_DIR=/home/runner/runner/cargo-target

# Non-root runner user. Passwordless sudo so workflows can still do
# `sudo apt-get install ...` for one-off deps — safe inside the
# container's isolated rootfs.
Expand Down
Loading