File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,6 +45,23 @@ USER nonroot:nonroot
4545
4646COPY --from=builder --chown=nonroot:nonroot /build/target/release/nodedb /usr/local/bin/nodedb
4747
48+ # nodedb dynamically links libz.so.1 (transitively via crates that default to
49+ # system zlib — e.g. flate2 with its default `zlib` feature). Chainguard's
50+ # glibc-dynamic ships only glibc + libgcc + ca-certs + tzdata, so the runtime
51+ # fails immediately with: "error while loading shared libraries: libz.so.1:
52+ # cannot open shared object file: No such file or directory".
53+ #
54+ # Copy the Debian builder's libz into a default ld.so search path. The glob
55+ # covers both amd64 and arm64 — per-arch builds only see their own multiarch
56+ # directory, so exactly one match per build.
57+ #
58+ # Long-term cleanup options (any of these would let us drop this COPY):
59+ # * Switch flate2 (and any other zlib-using deps) to the `rust_backend`
60+ # feature so libz becomes a build-time C lib statically linked.
61+ # * Or vendor libz via the `libz-sys` `static` feature.
62+ # * Or move runtime to `cgr.dev/chainguard/wolfi-base` + `apk add zlib`.
63+ COPY --from=builder /lib/*-linux-gnu/libz.so.1 /usr/lib/libz.so.1
64+
4865# Bind to all interfaces (required for Docker port mapping)
4966# Point data dir at the declared volume
5067ENV NODEDB_HOST=0.0.0.0 \
You can’t perform that action at this time.
0 commit comments