Conversation
`distroless` provides an excellent base image to run Rust programs. For Rust programs linked with musl, use `distroless/static` which weights ~2MB. For Rust programs linked with glibc, use `distroless/cc` which is ~20MB
|
@jirutka Curious why the downvote. |
|
Because this project is about “How to minimize Rust binary size”, not how to containerize (or distribute in more general sense) Rust programs. So IMHO this is out of scope of this project. Moreover, if you want a self-contained program, you can just build a static binary with musl; there’s no reason to wrap it in a container image, unless you have an environment that knows only containers. And again, this is a completely different topic. |
|
Thank you for your sharing your thoughts! |
|
You’re welcome! :) |
|
|
@Xerxes-2 Thanks for your contribution. |
I see, I overlooked this section. In that case, this PR is indeed a good addition. |
|
Ya know, if someone really hates containers enough, then some min-sized-containers repo could be a nice trolling opportunity, maybe reinvent dynamic linking behind the scenes. ;) |
distrolessprovides an excellent base image to run Rust programs. For Rust programs linked with musl, usedistroless/staticwhich weights ~2MB. For Rust programs linked with glibc, usedistroless/ccwhich is ~20MB