Skip to content

Commit d652d21

Browse files
committed
fix: ship libquiche.so.0 into runtime image so curl -V works
libcurl.so.4 is dynamically linked against libquiche.so.0 (DT_SONAME), but the runtime stage only copies /curl/usr/local/ and the embedded rpath pointed at the builder-only path /opt/quiche-src/target/release. The result: the final image was missing libquiche.so.0, so 'curl -V' died with Error loading shared library libquiche.so.0: No such file or directory Error relocating .../libcurl.so.4: quiche_* symbol not found This went undetected because 'Test curl -V' is gated 'if: github.event_name != push', so push builds never ran it; the weekly schedule run is what first exercised the broken image. Install libquiche.so.0 (+ .so symlink) into /curl/usr/local/lib and repoint the rpath at /usr/local/lib so the loader finds it in the final image. Verified locally (native arm64): curl -V exits 0, reports quiche/0.29.0, ldd resolves libquiche.so.0 => /usr/local/lib/libquiche.so.0.
1 parent ef02cfc commit d652d21

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,14 @@ RUN mkdir -p /opt/curl-src && \
3232
rm /opt/curl.tar.gz
3333
RUN cd /opt/curl-src && \
3434
autoreconf -fi && \
35-
./configure LDFLAGS="-Wl,-rpath,/opt/quiche-src/target/release" --with-openssl=/opt/quiche-src/quiche/deps/boringssl/src --with-quiche=/opt/quiche-src/target/release --with-nghttp2 --with-zlib && \
35+
./configure LDFLAGS="-Wl,-rpath,/usr/local/lib" --with-openssl=/opt/quiche-src/quiche/deps/boringssl/src --with-quiche=/opt/quiche-src/target/release --with-nghttp2 --with-zlib && \
3636
make -j $(nproc) && \
37-
make DESTDIR="/curl/" install
37+
make DESTDIR="/curl/" install && \
38+
# libcurl.so.4 dynamically NEEDs libquiche.so.0; ship it into the runtime
39+
# image (only /curl/usr/local is copied to the final stage) and point the
40+
# rpath above at /usr/local/lib so the loader finds it there.
41+
install -D -m755 /opt/quiche-src/target/release/libquiche.so /curl/usr/local/lib/libquiche.so.0 && \
42+
ln -sf libquiche.so.0 /curl/usr/local/lib/libquiche.so
3843

3944
FROM alpine:edge
4045
RUN apk add --no-cache nghttp2 zlib libpsl bash perl ca-certificates

0 commit comments

Comments
 (0)