Commit 749614f
committed
fix(docker): add libz.so.1 to runtime image
The Chainguard glibc-dynamic runtime introduced in 8b520a8 ships only
glibc + libgcc + ca-certs + tzdata. nodedb's binary dynamically links
libz.so.1 (transitively via crates that default to system zlib, e.g.
flate2 with its default `zlib` feature), causing immediate startup
failure on the v0.1.0 image:
error while loading shared libraries: libz.so.1:
cannot open shared object file: No such file or directory
This patch copies libz from the Debian builder stage into /usr/lib of
the runtime, where the dynamic linker finds it via the default search
path. The source path glob covers both amd64 and arm64 multiarch
layouts — only the building arch's directory exists per matrix job.
Long-term cleanup options (any of which would let us drop this COPY):
* Switch flate2 (and any other zlib-using deps) to `rust_backend`,
making libz a build-time C lib statically linked into the binary.
* Or vendor libz via the `libz-sys` `static` feature.
* Or move runtime to `cgr.dev/chainguard/wolfi-base` + `apk add zlib`.
Reproducer (with v0.1.0 image):
docker run --rm farhansyah/nodedb:0.1.01 parent 1d13629 commit 749614f
1 file changed
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
48 | 65 | | |
49 | 66 | | |
50 | 67 | | |
| |||
0 commit comments