diff --git a/osdk/tools/docker/Dockerfile b/osdk/tools/docker/Dockerfile index b49bab125..f0233014c 100644 --- a/osdk/tools/docker/Dockerfile +++ b/osdk/tools/docker/Dockerfile @@ -145,6 +145,12 @@ RUN curl https://sh.rustup.rs -sSf | \ && cargo -V \ && rustup component add rust-src rustc-dev llvm-tools-preview +# Let Github runners reuse the Rust toolchain installed in the Dockerfile and +# also the Cargo crates downloaded subsequently in the Docker build process. +RUN mkdir -p /github/home \ + && ln -s /root/.cargo /github/home/.cargo \ + && ln -s /root/.rustup /github/home/.rustup + # Install cargo tools RUN cargo install \ cargo-binutils \ diff --git a/tools/docker/nix/Dockerfile b/tools/docker/nix/Dockerfile index a2236353e..2c231c33c 100644 --- a/tools/docker/nix/Dockerfile +++ b/tools/docker/nix/Dockerfile @@ -39,6 +39,10 @@ RUN make general_pkgs VERBOSE=0 \ # Clean source files RUN rm -rf /root/test +# Let Github runners reuse Nixpkgs tarball installed in the Dockerfile. +RUN mkdir -p /github/home/.cache \ + && ln -s /root/.cache/nix /github/home/.cache/nix + VOLUME [ "/root/asterinas" ] WORKDIR /root/asterinas