Skip to content

Commit b3d492f

Browse files
authored
Update Dockerfile to use cargo-chef base image (#73)
* Update Dockerfile to use cargo-chef base image - Avoid crates.io timeouts - Speed up Docker builds * Update Dockerfile base images - Optimize build time in runtime stage using a lighter image - Fix verisioning mismatch in stdlibc++ - Pin images using digests
1 parent 8e6edbd commit b3d492f

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎Dockerfile‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM rust:1.85-bookworm AS chef
1+
FROM lukemathwalker/cargo-chef:latest-rust-1.88-bookworm@sha256:d184d41fd934afd282bf8f04b602aaa952af88341c48b8738b0c0a85ac7a6cec AS chef
22

33
WORKDIR /app
44

@@ -11,8 +11,6 @@ RUN apt-get update && apt-get install -y \
1111
build-essential \
1212
&& rm -rf /var/lib/apt/lists/*
1313

14-
RUN cargo install cargo-chef
15-
1614
# Planner Stage
1715
FROM chef AS planner
1816

@@ -35,8 +33,9 @@ COPY crates ./crates
3533
# Building the binary
3634
RUN cargo build --release --bin server
3735

36+
3837
# Runtime Stage
39-
FROM debian:bookworm-slim
38+
FROM debian:bookworm-slim@sha256:f06537653ac770703bc45b4b113475bd402f451e85223f0f2837acbf89ab020a AS runtime
4039

4140
RUN apt-get update && apt-get install -y \
4241
ca-certificates \

0 commit comments

Comments
 (0)