Include cmake?
Some -sys crates use cmake to build their native libraries. It would be nice if it was included in the image already.
Which crates did you run into the require cmake, specifically?
onig-sys: https://github.com/rust-onig/rust-onig/blob/master/onig_sys/build.rs
I can submit a PR for this if it helps with the consideration :).
The main thing I wanted to check is how much it increases the size of the resulting image.
@robinst Is there any reason you don't want to install cmake in your own Dockerfiles? Most of the projects I use this image for don't use cmake and adding unused dependencies doesn't seem ideal.
@frewsxcv Yes, I don't want to run the whole apt-get and cleanup dance in my own Dockerfile.
If space is a concern, then I'd probably start with replacing build-essential by individual packages instead, so that it doesn't pull in the unneeded dpkg-dev.
Yeah, makes sense after I learned this image is batteries-included and not meant to be minimally just Rust
Just because the image includes some batteries doesn't mean I want to add a dependency every time it would've been useful in someone's project. When I started this image I actually wanted to build it from an Alpine Linux image to reduce its size, but it isn't yet possible to build a rustc targeting musl. (Or at least it wasn't at the time.) I'd probably be more interested in slimming this image down by replacing build-essential with specific components, as @robinst suggests, than adding new stuff.
I picked a few other tools to include in the image because I felt like the image wouldn't be particularly useful without them. That is, basically everyone would need to build another image on top adding OpenSSL, at least. There's a fine line between supporting the majority of use cases and keeping everyone from needing to build their own image. It's hard to figure out where that line should be.
but it isn't yet possible to build a rustc targeting musl. (Or at least it wasn't at the time.)
It is, and there's an excellent Docker image for that (and it includes cmake): https://github.com/clux/muslrust
I'm using it now to build a statically linked binary with, and then put the result into a new image based on alpine. The resulting image is 8 MB for my case (but of course it depends on how many dependencies are used). That is hard to beat :).
It's hard to figure out where that line should be.
Yeah. Would it make sense to separate the concerns of the build image from the runtime image? It looks like this project is currently trying to be both. The runtime image wouldn't need build tools or -dev packages or git at all.