cargo-chef 0.1.78

A cargo sub-command to build project dependencies for optimal Docker layer caching.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
ARG BASE_IMAGE=rust
FROM $BASE_IMAGE
ARG CHEF_TAG
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse

# Install musl-dev on Alpine to avoid error "ld: cannot find crti.o: No such file or directory"
RUN ((cat /etc/os-release | grep ID | grep alpine) && apk add --no-cache musl-dev || true) \
    && cargo install cargo-chef --locked --version $CHEF_TAG \
    && rm -rf $CARGO_HOME/registry/

LABEL org.opencontainers.image.source="https://github.com/LukeMathWalker/cargo-chef"
LABEL org.opencontainers.image.description="Cache the dependencies of your Rust project and speed up your Docker builds"