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.
I use the following docker command to compile my app with the latest nightly version:
docker run --rm -it -v "$HOME/.cargo/registry":/home/rust/.cargo/registry -v "$(pwd)":/home/rust/src ekidd/rust-musl-builder:nightly /bin/bash -c "rustup update; cargo build --verbose --release"
previously this worked, but now the update fails and it uses the older nightly version, which is incompatible with my code:
Unable to find image 'ekidd/rust-musl-builder:nightly' locally
nightly: Pulling from ekidd/rust-musl-builder
Status: Downloaded newer image for ekidd/rust-musl-builder:nightly
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
info: downloading component 'rustc'
43.8 MiB / 43.8 MiB (100 %) 5.6 MiB/s ETA: 0 s
info: downloading component 'rust-std'
71.0 MiB / 71.0 MiB (100 %) 5.6 MiB/s ETA: 0 s
info: downloading component 'cargo'
9.4 MiB / 9.4 MiB (100 %) 9.1 MiB/s ETA: 0 s
info: downloading component 'rust-docs'
11.3 MiB / 11.3 MiB (100 %) 7.4 MiB/s ETA: 0 s
info: downloading component 'rust-std' for 'x86_64-unknown-linux-musl'
14.8 MiB / 14.8 MiB (100 %) 6.1 MiB/s ETA: 0 s
info: rolling back changes
error: could not rename component directory from '/home/rust/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/share/doc/rust/html' to '/home/rust/.rustup/tmp/n9q7qtc1ziteopal_dir/bk'
info: checking for self-updates
nightly-x86_64-unknown-linux-gnu update failed - rustc 1.17.0-nightly (a559452b0 2017-03-17)
I use the following docker command to compile my app with the latest nightly version:
docker run --rm -it -v "$HOME/.cargo/registry":/home/rust/.cargo/registry -v "$(pwd)":/home/rust/src ekidd/rust-musl-builder:nightly /bin/bash -c "rustup update; cargo build --verbose --release"
previously this worked, but now the update fails and it uses the older nightly version, which is incompatible with my code: