File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
2126FROM 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-
3228COPY --from=builder /usr/local/bin/panmap /usr/local/bin/
29+ COPY --from=builder /runtime-libs/ /usr/lib/
3330
31+ RUN ldconfig && useradd -m panmap
3432USER panmap
3533ENTRYPOINT ["panmap" ]
You can’t perform that action at this time.
0 commit comments