From 5226ff4f8d55e957482f43892fa693dc02d8ddab Mon Sep 17 00:00:00 2001 From: dylan Date: Mon, 6 Oct 2025 19:12:24 -0600 Subject: [PATCH 1/4] fix glibc errors --- Dockerfile | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index b1769916..7e815c4d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,8 @@ # syntax=docker/dockerfile:1.7-labs ### STAGE 0: Create base chef image for building -### cargo chef is used to speed up the build process by caching dependencies using docker -FROM --platform=$TARGETPLATFORM lukemathwalker/cargo-chef:latest-rust-latest as chef +### Use a Debian bookworm-based Rust image so GLIBC matches the final runtime (bookworm ships glibc 2.36) +### cargo-chef is then installed into this pinned base +FROM --platform=$TARGETPLATFORM rust:1.90-bookworm AS chef RUN cargo install cargo-chef @@ -20,7 +21,15 @@ RUN cargo chef prepare ### this takes advantage of docker layer caching to the max FROM chef as builder COPY --from=planner /app/recipe.json recipe.json -RUN apt-get update && apt-get -y upgrade && apt-get install -y gcc libclang-dev pkg-config libssl-dev +RUN apt-get update && apt-get -y upgrade && apt-get install -y \ + gcc \ + libclang-dev \ + pkg-config \ + libssl-dev + # git \ + # openssh-client \ + # make \ + # perl RUN --mount=type=ssh cargo chef cook --release --recipe-path recipe.json --bin zenith-builder-example COPY --exclude=target . . @@ -29,7 +38,10 @@ RUN --mount=type=ssh cargo build --release --bin zenith-builder-example # Stage 3: Final image for running in the env FROM --platform=$TARGETPLATFORM debian:bookworm-slim -RUN apt-get update && apt-get -y upgrade && apt-get install -y libssl-dev ca-certificates +RUN apt-get update && apt-get -y upgrade && apt-get install -y \ + libssl3 \ + ca-certificates \ + && rm -rf /var/lib/apt/lists/* COPY --from=builder /app/target/release/zenith-builder-example /usr/local/bin/zenith-builder-example From c94d53440255db2b15bd008e998d55ab205a2a83 Mon Sep 17 00:00:00 2001 From: dylan Date: Mon, 6 Oct 2025 19:23:04 -0600 Subject: [PATCH 2/4] cleanup --- Dockerfile | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7e815c4d..8ba1ffcd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,10 +26,6 @@ RUN apt-get update && apt-get -y upgrade && apt-get install -y \ libclang-dev \ pkg-config \ libssl-dev - # git \ - # openssh-client \ - # make \ - # perl RUN --mount=type=ssh cargo chef cook --release --recipe-path recipe.json --bin zenith-builder-example COPY --exclude=target . . @@ -40,8 +36,7 @@ RUN --mount=type=ssh cargo build --release --bin zenith-builder-example FROM --platform=$TARGETPLATFORM debian:bookworm-slim RUN apt-get update && apt-get -y upgrade && apt-get install -y \ libssl3 \ - ca-certificates \ - && rm -rf /var/lib/apt/lists/* + ca-certificates COPY --from=builder /app/target/release/zenith-builder-example /usr/local/bin/zenith-builder-example From 3cbc74fdbb0057394f0f128997c2991d96198ffe Mon Sep 17 00:00:00 2001 From: dylan Date: Mon, 6 Oct 2025 19:24:19 -0600 Subject: [PATCH 3/4] moar clean --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8ba1ffcd..8ba89a2f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,7 +35,7 @@ RUN --mount=type=ssh cargo build --release --bin zenith-builder-example # Stage 3: Final image for running in the env FROM --platform=$TARGETPLATFORM debian:bookworm-slim RUN apt-get update && apt-get -y upgrade && apt-get install -y \ - libssl3 \ + libssl-dev \ ca-certificates COPY --from=builder /app/target/release/zenith-builder-example /usr/local/bin/zenith-builder-example From b83f0e26abd24a023f0d15b49ce77987d40d367d Mon Sep 17 00:00:00 2001 From: dylan Date: Tue, 7 Oct 2025 15:40:54 -0600 Subject: [PATCH 4/4] loosen build stage image to rust bookworm --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8ba89a2f..254d8b14 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ ### STAGE 0: Create base chef image for building ### Use a Debian bookworm-based Rust image so GLIBC matches the final runtime (bookworm ships glibc 2.36) ### cargo-chef is then installed into this pinned base -FROM --platform=$TARGETPLATFORM rust:1.90-bookworm AS chef +FROM --platform=$TARGETPLATFORM rust:bookworm AS chef RUN cargo install cargo-chef