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

Use bionic and update dependencies #67

Closed xrl closed 5 years ago

xrl commented 5 years ago

I had trouble building my CLI app with diesel/openssl support. Turns out it does matter the order of extern crate foo; does matter. While I threw everything possible at the wall, I tried building my own rust-musl-builder image.

One of the g++ dependency was failing to install, owing to something wrong in the Ubuntu archives no doubt. And I use bionic elsewhere in my infrastructure so I thought it would be helpful to upgrade to a new LTS release. It was pretty easy, the biggest change is dragging in gcc8 libraries vs 4.7.

I also upgrade the custom built dependencies. OpenSSL gets LTS release 1.0.2q, postgres gets bumped to 9.6.9.

I don't think the linked issue https://github.com/rust-lang/rust/issues/34978 matters anymore. I have successfully built using this image and I'm happy with it.

Also, pro-tip to anyone who wants to build their own rust-musl for nightly, use docker build's build-args to override the toolchain:

docker build --build-arg="TOOLCHAIN=nightly-2019-01-09" -t rust-musl:nightly .
emk commented 5 years ago

Thank you for this PR! You're right, we should upgrade this to the latest LTS.

emk commented 5 years ago

I've upgraded to the latest LTS, OpenSSL, etc. You can find it on the experimental branch while I test it against various existing apps. Thank you!