Cargo-Chef
Fleeting- External reference: https://www.lpalmieri.com/posts/fast-rust-docker-builds/
5x Faster Rust Docker Builds with cargo-chef | A learning journal
Most programming languages follow the same playbook: you COPY a lock-file of some kind first, build your dependencies, COPY over the rest of your source code and then build your project
most of the work is cached as long as your dependency tree does not change between one build and the next.
copy the lock file, create a dummy main.rs file, build the project, delete the dummy file, copy over your source code, build again
cargo-chef hopefully provides a streamlined workflow to help more people leverage Docker layer caching in their projects.