The Basics
Cargo Chef
Build Rust apps for Fly.io with a cargo-chef Dockerfile that caches dependency builds in a separate layer and ships the binary in a slim Debian runtime image.
We model the Dockerfile for Rust projects after the cargo chef project. The reason for that is that the build images are very small and the builds are quick after the initial build.
The image template looks something like this:
You can read more about cargo chef on the GitHub Repository.