Skip to content

Commit 60c3b30

Browse files
authored
fix: glibc runtime errors (#159)
# fix: glibc runtime errors This PR updates the docker stage 0 to use a known version of `bookworm`​ in for the next `cargo-chef`​ build step instead of the `lukemathwalker/cargo-check`​ image that it previously used in order to maintain `glibc`​ compatibility with the `debian:bookwork-slim`​ image used in stage 3. ## Testing Built a container with github actions and ran it in DevNet - tl;dr it landed blocks and the runtime error was gone. Closes [ENG-1424](https://linear.app/initiates/issue/ENG-1424/builder-main-branch-builds-are-broken)
1 parent cb3bc3c commit 60c3b30

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

β€ŽDockerfileβ€Ž

Lines changed: 11 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:bookworm AS chef
56

67
RUN cargo install cargo-chef
78

@@ -20,7 +21,11 @@ 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
2429

2530
RUN --mount=type=ssh cargo chef cook --release --recipe-path recipe.json --bin zenith-builder-example
2631
COPY --exclude=target . .
@@ -29,7 +34,9 @@ RUN --mount=type=ssh cargo build --release --bin zenith-builder-example
2934

3035
# Stage 3: Final image for running in the env
3136
FROM --platform=$TARGETPLATFORM debian:bookworm-slim
32-
RUN apt-get update && apt-get -y upgrade && apt-get install -y libssl-dev ca-certificates
37+
RUN apt-get update && apt-get -y upgrade && apt-get install -y \
38+
libssl-dev \
39+
ca-certificates
3340

3441
COPY --from=builder /app/target/release/zenith-builder-example /usr/local/bin/zenith-builder-example
3542

0 commit comments

Comments
Β (0)