emk / rust-musl-builder

Docker images for compiling static Rust binaries using musl-libc and musl-gcc, with static versions of useful C libraries. Supports openssl and diesel crates.
Apache License 2.0
1.54k stars 193 forks source link

Mount local crates into container #25

Closed stuartnelson3 closed 7 years ago

stuartnelson3 commented 7 years ago

Would you be interested in adding a note to the README about mounting the local cache to speed up build times? It stores the crates on the host machine in-between builds, and speeds up the overall build process.

# CACHE_DIR is probably $HOME/.cargo/registry

docker run --rm -it -v $CACHE_DIR:/home/rust/.cargo/registry -v $(pwd):/home/rust/src ekidd/rust-musl-builder:nightly cargo build
emk commented 7 years ago

Interesting idea!

I'm a bit reluctant to officially document this, because it seems like the kind of thing which might result in more support requests. rust-musl-builder is maintained, and it's used by several projects, but I'm less interested in adding new features.

I think there's a more ambitious Docker-based building setup out there, which might be worth looking into if you need something fancier.

stuartnelson3 commented 7 years ago

Cool, no worries!