I came a across an issue regarding Docker and Rust.
Im using the following guide to build and deploy an image of a rust server – https://docs.docker.com/language/rust/build-images/
Im getting the following error when trying to run the docker build --tag docker-rust-image .
command:
--------------------
29 | # output directory before the cache mounted /app/target is unmounted.
30 | >>> RUN --mount=type=bind,source=src,target=src
31 | >>> --mount=type=bind,source=Cargo.toml,target=Cargo.toml
32 | >>> --mount=type=bind,source=Cargo.lock,target=Cargo.lock
33 | >>> --mount=type=cache,target=/app/target/
34 | >>> --mount=type=cache,target=/usr/local/cargo/git/db
35 | >>> --mount=type=cache,target=/usr/local/cargo/registry/
36 | >>> cargo build --locked --release &&
37 | >>> cp ./target/release/$APP_NAME /bin/server
38 |
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 5e61c6a8-f6f0-45f7-9c2b-479c85d302bb::mocuc6bjkq90racgq71t4rqjv: "/src": not found```
my RUSTC version – rustc 1.81.0-nightly (ba1d7f4a0 2024-06-29)