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

Updating the embedded rust version fails #13

Closed tisoft closed 7 years ago

tisoft commented 7 years ago

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)
emk commented 7 years ago

Updating Rust using rustup inside the image is not supported. You could try rebuilding the image using TOOLCHAIN build argument as seen here: https://github.com/emk/rust-musl-builder/blob/master/hooks/build#L14