ConceptsBuilds & runtimes
Rust
What the generated Dockerfile does for a Rust project, when you set no build or start command.
In the build image, Cargo fetches the dependencies.
1 / 3
A Rust build uses two images. The first image has the Rust tools and compiles the app. The second image only runs the binary.
The defaults
| Step | What Ferry does |
|---|---|
| Build image | rust:1-slim-bookworm |
| Run image | debian:bookworm-slim |
| Dependencies | Cargo fetches them. Ferry keeps the registry and the target directory in build caches between builds. |
| Build | cargo build --release. Ferry installs the binary in /usr/local/bin. |
| Start | The binary that default-run names. If there is none, the binary of the package. If there is none, the first [[bin]] target. |
When Cargo.lock depends on openssl-sys, Ferry installs OpenSSL.
The run image also has your source tree in /app. This is the directory where the app starts.