You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's an example dockerfile I use with cargo-chef for faster builds . just place it in the root of your codebase in Dockerfile . replace your_binary with whatever your built artifact is called.
FROM rust:bookworm as chef
RUN cargo install cargo-chef
WORKDIR app
FROM chef as planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY --from=planner /app/recipe.json recipe.json
#Build deps (Cached)RUN cargo chef cook --release --recipe-path recipe.json
#Build applicationCOPY . .
RUN cargo build --release
FROM debian:bookworm as runtime
WORKDIR /app/
COPY --from=builder /app/target/release/YOUR_BINARY
CMD ["/app/YOUR_BINARY"]
build with something like docker build -t YOUR_DOCKER_REPO/YOUR_APP:latest .
No description provided.
The text was updated successfully, but these errors were encountered: