# cargo-chef

> Cache the dependencies of your Rust project and speed up your Docker builds.

Source: https://talira.ai/catalog/cargo-chef-77antavs
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Command-line tool
- Categories: [developer tools / build / docker](https://talira.ai/categories/developer-tools/build/docker), [developer tools / build / caching](https://talira.ai/categories/developer-tools/build/caching), [languages / rust](https://talira.ai/categories/languages/rust)
- Platforms: linux, docker, cli
- Licence: Apache-2.0
- Pricing: Free and open source
- Free tier: yes
- Self-hostable: yes
- Creator: Luca Palmieri (LukeMathWalker), author of Zero to Production in Rust

cargo-chef is a Cargo subcommand that makes [Docker](https://talira.ai/catalog/docker-engine-9442r3nw.md) layer caching work for Rust. `cargo chef prepare` computes a recipe of the project's dependency skeleton, and `cargo chef cook` builds only the dependencies in an earlier Docker layer, so source changes don't invalidate the dependency build. It was written for the deployment chapter of Zero to Production in Rust and is not meant to be run on a local checkout.

## Links

- GitHub: https://github.com/LukeMathWalker/cargo-chef

## Ways to install

### Package managers

- [Homebrew](https://talira.ai/catalog/homebrew-djy17yn9.md): <https://formulae.brew.sh/formula/cargo-chef>[^1]

## Problems it solves

- every code change makes my Rust Dockerfile rebuild all dependencies
- docker build for a Rust service takes 15 minutes even for a one-line change
- cache Rust crates in a Docker layer the way npm install gets cached
- COPY . . invalidates the cargo build layer every time
- speed up building Rust container images in CI
- multi-stage Dockerfile for Rust that doesn't recompile the world
- separate dependency compilation from application compilation in a container build
- my deploy pipeline spends most of its time compiling crates that never change

## Features

- prepare: dependency recipe
- cook: build dependencies only
- works with multi-stage Dockerfiles

## Capabilities

- Has a command line tool: plan not known

## Trust

Overall: 0.47 out of 1.
Signals: maintenance 0.45, adoption 0.69, momentum 0.48, community 0.73, backing 0.20, extensibility 0.20.

- last commit 3 months ago
- latest release v0.1.78 3 months ago
- 2.7k GitHub stars
- 67 contributors
- created by Luca Palmieri (LukeMathWalker), author of Zero to Production in Rust

## Alternatives

- [sccache](https://talira.ai/catalog/sccache-3e1w9xr3.md): Shared compilation cache for C, C++, Rust and CUDA, stored locally or in the cloud
- [BuildKit](https://talira.ai/catalog/buildkit-bbrmdm7c.md): concurrent, cache-efficient, and Dockerfile-agnostic builder toolkit
- [Depot](https://talira.ai/catalog/depot-5c7bvbqp.md): Software delivery built for machine scale
- [WarpBuild](https://talira.ai/catalog/warpbuild-2241xsag.md): High-performance GitHub Actions runners: 2x faster, 50% cheaper

## Sources

[^1]: https://formulae.brew.sh/api/formula.json (checked 21 Nov 2026)
