Skip to content

Commit adbcf40

Browse files
committed
fix glibc errors
1 parent 6d5c872 commit adbcf40

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

Dockerfile

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# syntax=docker/dockerfile:1.7-labs
22
### 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
56

67
RUN cargo install cargo-chef
78

@@ -20,7 +21,15 @@ RUN cargo chef prepare
2021
### this takes advantage of docker layer caching to the max
2122
FROM chef as builder
2223
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
2433

2534
RUN --mount=type=ssh cargo chef cook --release --recipe-path recipe.json --bin zenith-builder-example
2635
COPY --exclude=target . .
@@ -29,7 +38,10 @@ RUN --mount=type=ssh cargo build --release --bin zenith-builder-example
2938

3039
# Stage 3: Final image for running in the env
3140
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/*
3345

3446
COPY --from=builder /app/target/release/zenith-builder-example /usr/local/bin/zenith-builder-example
3547

0 commit comments

Comments
 (0)