Open synek317 opened 2 years ago
This seems pretty reasonable to me I think. We'd probably want to call the image rustup
rather than rust
to avoid too much tag confusion.
This would be especially handy for CI when you have multiple targets managed by rust-toolchain
. It makes it easy to cache the RUSTUP_HOME
to store all of the targets/components without needing to double download targets that are baked into the docker image.
Do you think it would be possible to provide Dockerfile that only installs rustup?
It would be useful for people who are fine with stable rustup but would like to use any version of rust via rust-toolchain file.
I'm not a Docker expert but I think it could be the same as the image in this repository except installing cargo. I've been using the example below for quite a while with cached several directories (
--mount=type=cache,target="/usr/local/rustup" --mount=type=cache,target="/usr/local/cargo/git" --mount=type=cache,target="/usr/local/cargo/registry" --mount=type=cache,target="/src/target",sharing=private
):