Skip to content

Commit 8b013f8

Browse files
committed
Fix Docker runtime: copy all shared libs from builder
1 parent 5c5660a commit 8b013f8

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

Dockerfile

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,17 @@ RUN cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
1717
&& cmake --build build -j$(nproc) \
1818
&& cmake --install build --prefix /usr/local
1919

20+
# Collect all shared library dependencies for the runtime stage
21+
RUN mkdir -p /runtime-libs && \
22+
ldd /usr/local/bin/panmap | grep '=>' | awk '{print $3}' | \
23+
while read lib; do [ -f "$lib" ] && cp -L "$lib" /runtime-libs/; done
24+
2025
# Stage 2: Runtime
2126
FROM ubuntu:22.04
2227

23-
ENV DEBIAN_FRONTEND=noninteractive
24-
25-
RUN apt-get update && apt-get install -y --no-install-recommends \
26-
libboost-program-options1.74.0 libboost-iostreams1.74.0 \
27-
libboost-filesystem1.74.0 libboost-date-time1.74.0 \
28-
libprotobuf23 libcapnp-0.8.0 libhts3 zlib1g \
29-
&& rm -rf /var/lib/apt/lists/* \
30-
&& useradd -m panmap
31-
3228
COPY --from=builder /usr/local/bin/panmap /usr/local/bin/
29+
COPY --from=builder /runtime-libs/ /usr/lib/
3330

31+
RUN ldconfig && useradd -m panmap
3432
USER panmap
3533
ENTRYPOINT ["panmap"]

0 commit comments

Comments
 (0)