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.
README's section on caching builds suggests a few solutions to cache builds when you use rust-musl-builder through docker run. I've been trying to integrate this into my my multi-stage Dockerfile but I can't get it to work.
This does not work, and Docker throws this error on the last stage:
Step 7/13 : RUN cargo build --release
---> Running in 7a879da880ce
error: failed to get `chrono` as a dependency of package `rust-crawler v0.1.0 (/home/rust/src)`
Caused by:
failed to create directory `/home/rust/.cargo/registry/index/github.com-1ecc6299db9ec823`
Caused by:
Permission denied (os error 13)
README's section on caching builds suggests a few solutions to cache builds when you use
rust-musl-builder
throughdocker run
. I've been trying to integrate this into my my multi-stage Dockerfile but I can't get it to work.My Dockerfile looks roughly like this:
This does not work, and Docker throws this error on the last stage:
What am I doing wrong here?