rust-cross / rust-musl-cross

Docker images for compiling static Rust binaries using musl-cross
MIT License
620 stars 68 forks source link

smaller images #14

Closed xoac closed 6 years ago

xoac commented 6 years ago

I am wondering why this images are so big:

For example I think we don't need this:

rm -rf /root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/
root@8340dacc30e8:~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu# du -skh *
48M     bin
16K     etc
570M    lib
237M    share

Next question is here, maybe there are libs we don't need (and never need for musl target)?:

root@8340dacc30e8:~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib# du -skh *
4.0K    components
48K     etc
4.0K    manifest-cargo-x86_64-unknown-linux-gnu
4.0K    manifest-rust-docs-x86_64-unknown-linux-gnu
8.0K    manifest-rust-std-x86_64-unknown-linux-gnu
4.0K    manifest-rust-std-x86_64-unknown-linux-musl
4.0K    manifest-rustc-x86_64-unknown-linux-gnu
260K    multirust-channel-manifest.toml
4.0K    multirust-config.toml
4.0K    rust-installer-version
405M    x86_64-unknown-linux-gnu
85M     x86_64-unknown-linux-musl
messense commented 6 years ago

I think we can try to remove useless resources in the image, pull requests are welcome.

xoac commented 6 years ago

I have tried to reove some libs from 405M x86_64-unknown-linux-gnu but its looks they are used :(