Copy rust compiler from one container image onto another

I need to create a container image to run in my CI. I am actually testing a Python app, but one of its dependencies has Rust dependencies. Instead of installing Rust from scratch, I was wondering if I couldn't just copy across a couple of directories using a multi stage build?

Never did this myself, but if you are using rustup, I think the installation only spans the ~/.rustup and ~/.cargo directories. Plus adding the ~/.cargo/bin directory to your path.

1 Like