Automic VaultAutomic Vault

brew

Install cargo-chef with Homebrew, apk, Nix

Cargo subcommand to speed up Rust Docker builds using Docker layer caching. Version 0.1.77 via Homebrew; verified from local package data.

install

Additional install commands

macOS

Homebrewverified · 100%
brew install cargo-chef

local Homebrew formula metadata

Linux

Alpine Linux apkverified · 92%
sudo apk add cargo-chef

Alpine Linux edge package indexes · cargo-chef · source: dl-cdn.alpinelinux.org

Nixverified · 92%
nix profile install nixpkgs#cargo-chef

nixpkgs package indexes · pkgs/by-name/ca/cargo-chef/package.nix · source: api.github.com

overview

Package summary

Cargo subcommand to speed up Rust Docker builds using Docker layer caching

Commands and aliases

  • cargo-chef

history

Project history and usage

cargo-chef is a Cargo subcommand for making Rust container builds friendlier to Docker layer caching. It analyzes a project into a dependency recipe, builds that recipe in an earlier image layer, and lets later source-code-only changes reuse the expensive dependency build.

Project history

The project was created by Luca Palmieri in 2020 and its README says it was initially developed for the deployment chapter of Zero to Production in Rust. The upstream repository describes the command as a way to speed up Rust Docker builds using Docker layer caching.

Its design codified a pattern Rust teams were already hand-rolling in Dockerfiles: copy manifests first, build dependencies, then copy application sources. cargo-chef made that approach workspace-aware and less fragile by generating a recipe from Cargo.toml and Cargo.lock inputs.

Adoption history

cargo-chef spread through Rust backend and CI workflows because Docker build cache misses are especially painful for projects with large dependency graphs. The project publishes a prebuilt Docker image, and the crate has accumulated millions of crates.io downloads, showing adoption beyond a one-off example tool.

Packaging in Homebrew, apk, and Nix reflects its use by developers who want the subcommand available outside pure cargo-install workflows.

How it is used

A typical workflow runs `cargo chef prepare --recipe-path recipe.json` after copying the source tree in a planner stage, then `cargo chef cook --release --recipe-path recipe.json` in a builder stage before copying the full application code.

The README emphasizes that the tool is mainly intended for container builds, not normal local development, because it writes the project skeleton needed to cache dependencies.

Why package nerds care

For package managers, cargo-chef is interesting because it turns Cargo metadata into a build-cache artifact. It is a small CLI, but it sits directly at the intersection of Cargo workspaces, lockfiles, reproducible images, and CI build economics.

It is also a recognizable Rust ecosystem answer to the `requirements.txt`-style dependency layer used in other language containers.

Timeline

  • 2020: GitHub repository created and first crates.io release published.
  • 2020: README documents its origin in Zero to Production in Rust.
  • 2025-2026: Release stream continues through the 0.1.x series, with crates.io showing more than three million downloads by June 2026.

Related projects

  • Cargo is the package manager and build tool that cargo-chef extends.
  • Docker and the official Rust container images are the primary environment targeted by the documented workflow.
  • Zero to Production in Rust is the book project that originally motivated the tool.

security posture

Risk level: green

narrow executable package without higher-risk signals.

Risk classifier

green risk · low confidence · appliance

Why

  • narrow executable package without higher-risk signals

Signals

  • metadata:no-higher-risk-signals

Install behavior

  • No Homebrew post-install hook is recorded in formula metadata.
  • Homebrew bottle metadata is available for 6 platform targets.
  • Build metadata lists 1 build dependencies.

Recommended review

Before unattended agent use, check whether the tool reads plaintext credentials, writes remote state, publishes artifacts, or shells out to plugins.

executables

Installed executables

CommandKindExposureNote
cargo-chefcliglobal executable

freshness

Version and freshness

These signals separate page generation age, package-manager activity, and upstream release comparison. Version lag is warned only when an evidence URL and comparable versions are present.

page generated2026-07-08
manager version0.1.77
manager updated
local dataok
upstreamcurrent
latest detectedv0.1.77

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

  • infoNo package-manager update timestamp was available.low confidence

install metadata

Package metadata

Package keybrew:cargo-chef
Version0.1.77
Package managerHomebrew
Package manager pagehttps://formulae.brew.sh/formula/cargo-chef
Homepagehttps://github.com/LukeMathWalker/cargo-chef
Repositoryhttps://github.com/LukeMathWalker/cargo-chef
Upstream docshttps://github.com/LukeMathWalker/cargo-chef#readme
LicenseApache-2.0 OR MIT
Source archivehttps://github.com/LukeMathWalker/cargo-chef/archive/refs/tags/v0.1.77.tar.gz
Build dependenciesrust
Bottleavailable (on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux)
Homebrew post-installnot defined
Servicenone declared

registry facts

Source database details

Source DatabaseHomebrew formula API
Taphomebrew/core
Full Namecargo-chef
Version Scheme0
Revision0
Bottle Stable Root URLhttps://ghcr.io/v2/homebrew/core
Deprecatedno
Disabledno
Keg Onlyno
URL Keys
  • stable

source database matches

Other package-manager records

Matches are pulled from external package-manager indexes and kept separate from local Automic Vault package links.

Nix95%

cargo-chef

nix profile install nixpkgs#cargo-chef
  • normalized package name match
  • Matched by: Cargo Chef
nixpkgs package indexes · api.github.com · nixpkgs package indexes: pkgs/by-name/ca/cargo-chef/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
apk95%

cargo-chef 0.1.77-r0

A cargo sub-command to build project dependencies for optimal Docker layer caching.

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

sudo apk add cargo-chef
  • License: MIT OR Apache-2.0
  • Architecture: x86_64
  • Source Package: cargo-chef
  • 1 dependencies
  • 1 provides
  • normalized package name match
  • Matched by: Cargo Chef
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: cargo-chef from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
apk95%

cargo-chef-doc 0.1.77-r0

A cargo sub-command to build project dependencies for optimal Docker layer caching. (documentation)

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

sudo apk add cargo-chef-doc
  • License: MIT OR Apache-2.0
  • Architecture: x86_64
  • Source Package: cargo-chef
  • normalized package name match
  • Matched by: Cargo Chef
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: cargo-chef-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

source trail

Generated from repository data

This page is generated by av-web from the private package SQLite artifact built by scripts/generate-pkg-sqlite.py.

Used sources

  • Geiger risk classifier
  • Nucleus package database
  • av.db category and tag curation
  • cross-ecosystem install command graph
  • curated package history
  • external package-manager database matches
  • package relationship graph
  • package version freshness
  • package-page enrichment