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 \ |
| 45 | apt-get install -Uy --no-install-recommends $(cat /deps/ndn*) \ |
| 46 | && apt-get distclean |
| 47 | |
| 48 | ENV HOME=/config |
| 49 | VOLUME /config |
| 50 | VOLUME /run/nfd |