-
Notifications
You must be signed in to change notification settings - Fork 436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add cargo to the Docker image #543
Comments
I would be happy to contribute this (with the size comparison). |
@sobolevn feel free to give it a try and let us know then! The Dockerfile is in the repo. :) Thanks! |
Before adding
|
Thanks for looking into this!
We could update the base elixir images, so they will be alpine 3.14, which should give us more recent rust/cargo versions.
|
In this case there will be still a lot of problems with |
By including Rust, does it mean we automatically get the C toolchain too (or most of it)? |
Can you try building a version with debian-slim or ubuntu-slim and let us know if it is any better? |
Not directly, but by adding
Yes, will do tomorrow. |
I can report I have experienced that recently (see for instance rust-lang/cargo#7563). It appears to be a bit of a rabbit hole, and ultimately I decided to move one of our images to Ubuntu for that reason.
I was about to open an issue to report that exqlite was not installable in the LiveBook Docker image due to "make" and "gcc" missing. This means that ecto_sqlite3 cannot be used. I had to add I wonder if adding Rust would also add the tooling required to support SQLite datasets, something which is quite common in data exploration. |
What about a tag with Explorer preinstalled or with the precompiled binary? (or just a tag with Rust and C toolchain support, so we get the best of all worlds). |
We probably want to precompile stuff but it is still in the open if we want to do that at the Hex.pm level or at the Docker level. The issue with doing it in Docker is that if there is a new Explorer version, then the cache won't be helpful? In any case, I think we should at least move to Ubuntu so people can build their images on top of hours with Rust? |
This is already better than But, still pretty bad 🙂 New
|
@sobolevn is it faster because it is not using musl? What would happen if we use alpine and then use rustup to install rust for us? Would that use the libc toolchain instead or it is going to use whatever is on the OS instead? But yeah, the fact it still takes 1000s means we definitely need to precompile stuff. |
Yes, I think so. I'm not a
It looks like |
@sobolevn I see, thanks! In the article above, the image was still below <100MB. Maybe we can achieve similar low numbers here too if we have debian slim images? |
I guess an alternative is also to install lib in the alpine image... but not sure how much of a good idea that is. |
@josevalim sure, |
Requested slim images here: hexpm/bob#98 @sobolevn btw, there is another option here, which is to provide a |
We are currently exploring shipping a precompiled version of Explorer where rustc nor c compilers will be required. So for now, consider this issue as "stale". If for some reason those efforts fail, I will ping back here. |
Sorry to barge in. Just wanted to share a tidbit that shaved off ~500MB off of our Docker builder image (that we only extract an Elixir release from in the end but still). If you end up downloading RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable --profile minimal --target x86_64-unknown-linux-gnu -y This way or running
Details here: https://rust-lang.github.io/rustup/concepts/profiles.html Bonus points: the Debian/Ubuntu packages that made sure we can use Rustler fine are: |
Thank you for sharing! As per this issue, we just shipped precompilation for html5ever and we are contributing the mechanisms to Rustler soon, so we should be seeing more precompiled packages from now on. |
Really curious about |
I think it will be an increasingly common use case, so we should probably add it. How much does it add to the image? 🤔
The text was updated successfully, but these errors were encountered: