1
1
# syntax=docker/dockerfile:1.7-labs
2
2
# ## STAGE 0: Create base chef image for building
3
- # ## cargo chef is used to speed up the build process by caching dependencies using docker
4
- FROM --platform=$TARGETPLATFORM lukemathwalker/cargo-chef:latest-rust-latest as chef
3
+ # ## Use a Debian bookworm-based Rust image so GLIBC matches the final runtime (bookworm ships glibc 2.36)
4
+ # ## cargo-chef is then installed into this pinned base
5
+ FROM --platform=$TARGETPLATFORM rust:1.90-bookworm AS chef
5
6
6
7
RUN cargo install cargo-chef
7
8
@@ -20,7 +21,15 @@ RUN cargo chef prepare
20
21
# ## this takes advantage of docker layer caching to the max
21
22
FROM chef as builder
22
23
COPY --from=planner /app/recipe.json recipe.json
23
- RUN apt-get update && apt-get -y upgrade && apt-get install -y gcc libclang-dev pkg-config libssl-dev
24
+ RUN apt-get update && apt-get -y upgrade && apt-get install -y \
25
+ gcc \
26
+ libclang-dev \
27
+ pkg-config \
28
+ libssl-dev
29
+ # git \
30
+ # openssh-client \
31
+ # make \
32
+ # perl
24
33
25
34
RUN --mount=type=ssh cargo chef cook --release --recipe-path recipe.json --bin zenith-builder-example
26
35
COPY --exclude=target . .
@@ -29,7 +38,10 @@ RUN --mount=type=ssh cargo build --release --bin zenith-builder-example
29
38
30
39
# Stage 3: Final image for running in the env
31
40
FROM --platform=$TARGETPLATFORM debian:bookworm-slim
32
- RUN apt-get update && apt-get -y upgrade && apt-get install -y libssl-dev ca-certificates
41
+ RUN apt-get update && apt-get -y upgrade && apt-get install -y \
42
+ libssl3 \
43
+ ca-certificates \
44
+ && rm -rf /var/lib/apt/lists/*
33
45
34
46
COPY --from=builder /app/target/release/zenith-builder-example /usr/local/bin/zenith-builder-example
35
47
0 commit comments