Varun Patil | 35e6aff | 2024-05-04 14:14:06 -0700 | [diff] [blame] | 1 | # syntax=docker/dockerfile:1 |
| 2 | |
| 3 | ARG NDN_CXX_VERSION=latest |
| 4 | FROM ghcr.io/named-data/ndn-cxx-build:${NDN_CXX_VERSION} AS build |
| 5 | |
| 6 | RUN apt-get install -Uy --no-install-recommends \ |
| 7 | libpcap-dev \ |
| 8 | && apt-get distclean |
| 9 | |
| 10 | ARG JOBS |
| 11 | ARG SOURCE_DATE_EPOCH |
| 12 | RUN --mount=rw,target=/src <<EOF |
| 13 | set -eux |
| 14 | cd /src |
| 15 | ./waf configure \ |
| 16 | --prefix=/usr \ |
| 17 | --libdir=/usr/lib \ |
| 18 | --sysconfdir=/etc \ |
| 19 | --localstatedir=/var \ |
| 20 | --sharedstatedir=/var |
| 21 | ./waf build |
| 22 | ./waf install |
| 23 | mkdir -p /deps/debian |
| 24 | touch /deps/debian/control |
| 25 | cd /deps |
| 26 | for binary in ndnpeek ndnpoke ndncatchunks ndnputchunks ndnping ndnpingserver ndndump ndn-dissect; do |
| 27 | dpkg-shlibdeps --ignore-missing-info "/usr/bin/${binary}" -O \ |
| 28 | | sed -n 's|^shlibs:Depends=||p' | sed 's| ([^)]*),\?||g' > "${binary}" |
| 29 | done |
| 30 | EOF |
| 31 | |
| 32 | |
| 33 | FROM ghcr.io/named-data/ndn-cxx-runtime:${NDN_CXX_VERSION} AS ndn-tools |
| 34 | |
| 35 | COPY --link --from=build /usr/bin/ndnpeek /usr/bin/ |
| 36 | COPY --link --from=build /usr/bin/ndnpoke /usr/bin/ |
| 37 | COPY --link --from=build /usr/bin/ndncatchunks /usr/bin/ |
| 38 | COPY --link --from=build /usr/bin/ndnputchunks /usr/bin/ |
| 39 | COPY --link --from=build /usr/bin/ndnping /usr/bin/ |
| 40 | COPY --link --from=build /usr/bin/ndnpingserver /usr/bin/ |
| 41 | COPY --link --from=build /usr/bin/ndndump /usr/bin/ |
| 42 | COPY --link --from=build /usr/bin/ndn-dissect /usr/bin/ |
| 43 | |
| 44 | RUN --mount=from=build,source=/deps,target=/deps \ |
Davide Pesavento | 5b71cfa | 2024-06-07 17:44:06 -0400 | [diff] [blame] | 45 | apt-get install -Uy --no-install-recommends \ |
| 46 | $(cat /deps/ndn*) \ |
Varun Patil | 35e6aff | 2024-05-04 14:14:06 -0700 | [diff] [blame] | 47 | && apt-get distclean |
| 48 | |
| 49 | ENV HOME=/config |
| 50 | VOLUME /config |
| 51 | VOLUME /run/nfd |