Davide Pesavento | e76d7b5 | 2024-04-09 16:54:01 -0400 | [diff] [blame] | 1 | # syntax=docker/dockerfile:1 |
Varun Patil | 6ba08cd | 2023-11-18 13:54:52 -0800 | [diff] [blame] | 2 | |
Davide Pesavento | e76d7b5 | 2024-04-09 16:54:01 -0400 | [diff] [blame] | 3 | ARG NDN_CXX_VERSION=latest |
| 4 | FROM ghcr.io/named-data/ndn-cxx-build:${NDN_CXX_VERSION} AS build |
Davide Pesavento | e76d7b5 | 2024-04-09 16:54:01 -0400 | [diff] [blame] | 5 | |
| 6 | RUN apt-get install -Uy --no-install-recommends \ |
| 7 | libpcap-dev \ |
Davide Pesavento | c3bf8ad | 2024-05-03 20:20:54 -0400 | [diff] [blame] | 8 | && apt-get distclean |
Varun Patil | 6ba08cd | 2023-11-18 13:54:52 -0800 | [diff] [blame] | 9 | |
Davide Pesavento | 0f10b16 | 2024-04-14 18:12:02 -0400 | [diff] [blame] | 10 | ARG JOBS |
Davide Pesavento | c3bf8ad | 2024-05-03 20:20:54 -0400 | [diff] [blame] | 11 | ARG SOURCE_DATE_EPOCH |
| 12 | RUN --mount=rw,target=/src <<EOF |
Davide Pesavento | 48108e0 | 2024-05-13 19:04:25 -0400 | [diff] [blame] | 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 | --without-systemd |
| 22 | ./waf build |
| 23 | ./waf install |
| 24 | mkdir -p /deps/debian |
| 25 | touch /deps/debian/control |
| 26 | cd /deps |
| 27 | for binary in nfd nfdc; do |
| 28 | dpkg-shlibdeps --ignore-missing-info "/usr/bin/${binary}" -O \ |
| 29 | | sed -n 's|^shlibs:Depends=||p' | sed 's| ([^)]*),\?||g' > "${binary}" |
| 30 | done |
Davide Pesavento | e76d7b5 | 2024-04-09 16:54:01 -0400 | [diff] [blame] | 31 | EOF |
Varun Patil | 6ba08cd | 2023-11-18 13:54:52 -0800 | [diff] [blame] | 32 | |
Davide Pesavento | 01d0aa6 | 2024-04-12 00:30:05 -0400 | [diff] [blame] | 33 | |
| 34 | FROM ghcr.io/named-data/ndn-cxx-runtime:${NDN_CXX_VERSION} AS nfd-autoreg |
| 35 | |
| 36 | COPY --link --from=build /usr/bin/nfd-autoreg /usr/bin/ |
| 37 | |
Varun Patil | ec352f2 | 2024-05-06 17:23:12 -0700 | [diff] [blame] | 38 | ENV HOME=/config |
| 39 | VOLUME /config |
Davide Pesavento | 01d0aa6 | 2024-04-12 00:30:05 -0400 | [diff] [blame] | 40 | VOLUME /run/nfd |
| 41 | |
| 42 | ENTRYPOINT ["/usr/bin/nfd-autoreg"] |
| 43 | |
| 44 | |
| 45 | FROM ghcr.io/named-data/ndn-cxx-runtime:${NDN_CXX_VERSION} AS nfd-status-http-server |
| 46 | |
| 47 | COPY --link --from=build /usr/bin/nfdc /usr/bin/ |
| 48 | COPY --link --from=build /usr/bin/nfd-status-http-server /usr/bin/ |
| 49 | COPY --link --from=build /usr/share/ndn/ /usr/share/ndn/ |
| 50 | |
Davide Pesavento | c3bf8ad | 2024-05-03 20:20:54 -0400 | [diff] [blame] | 51 | RUN --mount=from=build,source=/deps,target=/deps \ |
Davide Pesavento | 48108e0 | 2024-05-13 19:04:25 -0400 | [diff] [blame] | 52 | apt-get install -Uy --no-install-recommends \ |
| 53 | $(cat /deps/nfdc) \ |
Davide Pesavento | 01d0aa6 | 2024-04-12 00:30:05 -0400 | [diff] [blame] | 54 | python3 \ |
Davide Pesavento | c3bf8ad | 2024-05-03 20:20:54 -0400 | [diff] [blame] | 55 | && apt-get distclean |
Davide Pesavento | 01d0aa6 | 2024-04-12 00:30:05 -0400 | [diff] [blame] | 56 | |
Varun Patil | ec352f2 | 2024-05-06 17:23:12 -0700 | [diff] [blame] | 57 | ENV HOME=/config |
| 58 | VOLUME /config |
Davide Pesavento | 01d0aa6 | 2024-04-12 00:30:05 -0400 | [diff] [blame] | 59 | VOLUME /run/nfd |
| 60 | |
Davide Pesavento | 48108e0 | 2024-05-13 19:04:25 -0400 | [diff] [blame] | 61 | EXPOSE 6380/tcp |
Davide Pesavento | 01d0aa6 | 2024-04-12 00:30:05 -0400 | [diff] [blame] | 62 | |
| 63 | ENTRYPOINT ["/usr/bin/nfd-status-http-server", "--address", "0.0.0.0"] |
| 64 | |
| 65 | |
Davide Pesavento | e76d7b5 | 2024-04-09 16:54:01 -0400 | [diff] [blame] | 66 | FROM ghcr.io/named-data/ndn-cxx-runtime:${NDN_CXX_VERSION} AS nfd |
Davide Pesavento | 01d0aa6 | 2024-04-12 00:30:05 -0400 | [diff] [blame] | 67 | |
| 68 | COPY --link --from=build /usr/bin/nfdc /usr/bin/ |
| 69 | COPY --link --from=build /usr/bin/nfd /usr/bin/ |
| 70 | COPY --link --from=build /etc/ndn/nfd.conf.sample /config/nfd.conf |
Varun Patil | 6ba08cd | 2023-11-18 13:54:52 -0800 | [diff] [blame] | 71 | |
Davide Pesavento | c3bf8ad | 2024-05-03 20:20:54 -0400 | [diff] [blame] | 72 | RUN --mount=from=build,source=/deps,target=/deps \ |
Davide Pesavento | 48108e0 | 2024-05-13 19:04:25 -0400 | [diff] [blame] | 73 | apt-get install -Uy --no-install-recommends \ |
| 74 | $(cat /deps/nfd /deps/nfdc) \ |
Davide Pesavento | c3bf8ad | 2024-05-03 20:20:54 -0400 | [diff] [blame] | 75 | && apt-get distclean |
Varun Patil | 6ba08cd | 2023-11-18 13:54:52 -0800 | [diff] [blame] | 76 | |
Varun Patil | 9b877c3 | 2023-11-18 17:48:49 -0800 | [diff] [blame] | 77 | ENV HOME=/config |
Varun Patil | 6ba08cd | 2023-11-18 13:54:52 -0800 | [diff] [blame] | 78 | VOLUME /config |
| 79 | VOLUME /run/nfd |
| 80 | |
Davide Pesavento | e76d7b5 | 2024-04-09 16:54:01 -0400 | [diff] [blame] | 81 | EXPOSE 6363/tcp 6363/udp 9696/tcp |
Varun Patil | 6ba08cd | 2023-11-18 13:54:52 -0800 | [diff] [blame] | 82 | |
| 83 | ENTRYPOINT ["/usr/bin/nfd"] |
| 84 | CMD ["--config", "/config/nfd.conf"] |