accounts-service crash-looped in production: GLIBC_2.38 not found. The builder stage used the floating rust:1-slim tag (now Debian trixie, glibc 2.38+) while the runtime stage used debian:bookworm-slim (glibc 2.36) — a base mismatch. Pin both stages to trixie so the runtime glibc is always at least as new as what the binary was linked against. Claude-Session: https://claude.ai/code/session_01F1M1Jic1wTSn4igUENynmZ
19 lines
759 B
Docker
19 lines
759 B
Docker
# Build context must be backend/ (the workspace root).
|
|
FROM rust:1-trixie AS builder
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
protobuf-compiler pkg-config libssl-dev ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
WORKDIR /build
|
|
COPY Cargo.toml Cargo.lock ./
|
|
COPY common ./common
|
|
COPY accounts-service ./accounts-service
|
|
COPY gateway ./gateway
|
|
COPY configs-service ./configs-service
|
|
RUN cargo build --release -p accounts-service
|
|
|
|
FROM debian:trixie-slim
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
ca-certificates libssl3 \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
COPY --from=builder /build/target/release/accounts-service /usr/local/bin/accounts-service
|
|
ENTRYPOINT ["/usr/local/bin/accounts-service"]
|