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 |
| 5 | ARG SOURCE_DATE_EPOCH |
| 6 | |
| 7 | RUN apt-get install -Uy --no-install-recommends \ |
| 8 | libpcap-dev \ |
| 9 | # use 'apt-get distclean' when we upgrade to ubuntu:24.04 |
Varun Patil | 6ba08cd | 2023-11-18 13:54:52 -0800 | [diff] [blame] | 10 | && rm -rf /var/lib/apt/lists/* |
| 11 | |
Davide Pesavento | e76d7b5 | 2024-04-09 16:54:01 -0400 | [diff] [blame^] | 12 | RUN --mount=type=bind,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 | --without-systemd |
| 22 | ./waf build |
| 23 | ./waf install |
Varun Patil | 6ba08cd | 2023-11-18 13:54:52 -0800 | [diff] [blame] | 24 | |
Davide Pesavento | e76d7b5 | 2024-04-09 16:54:01 -0400 | [diff] [blame^] | 25 | mkdir -p /deps/debian |
| 26 | touch /deps/debian/control |
| 27 | cd /deps |
| 28 | for binary in nfd nfdc nfd-autoreg; do |
| 29 | dpkg-shlibdeps --ignore-missing-info "/usr/bin/${binary}" -O \ |
| 30 | | sed -n 's|^shlibs:Depends=||p' | sed 's| ([^)]*),\?||g' > "${binary}" |
| 31 | done |
| 32 | EOF |
Varun Patil | 6ba08cd | 2023-11-18 13:54:52 -0800 | [diff] [blame] | 33 | |
Davide Pesavento | e76d7b5 | 2024-04-09 16:54:01 -0400 | [diff] [blame^] | 34 | FROM ghcr.io/named-data/ndn-cxx-runtime:${NDN_CXX_VERSION} AS nfd |
| 35 | ARG SOURCE_DATE_EPOCH |
Varun Patil | 6ba08cd | 2023-11-18 13:54:52 -0800 | [diff] [blame] | 36 | |
Davide Pesavento | e76d7b5 | 2024-04-09 16:54:01 -0400 | [diff] [blame^] | 37 | RUN --mount=type=bind,from=build,source=/deps,target=/deps \ |
| 38 | apt-get install -Uy --no-install-recommends $(cat /deps/nfd /deps/nfdc) \ |
| 39 | && rm -rf /var/lib/apt/lists/* |
Varun Patil | 6ba08cd | 2023-11-18 13:54:52 -0800 | [diff] [blame] | 40 | |
Davide Pesavento | e76d7b5 | 2024-04-09 16:54:01 -0400 | [diff] [blame^] | 41 | COPY --link --from=build /usr/bin/nfd /usr/bin/ |
| 42 | COPY --link --from=build /usr/bin/nfdc /usr/bin/ |
| 43 | COPY --link --from=build /etc/ndn/nfd.conf.sample /config/nfd.conf |
Varun Patil | 9b877c3 | 2023-11-18 17:48:49 -0800 | [diff] [blame] | 44 | |
| 45 | ENV HOME=/config |
| 46 | |
Varun Patil | 6ba08cd | 2023-11-18 13:54:52 -0800 | [diff] [blame] | 47 | VOLUME /config |
| 48 | VOLUME /run/nfd |
| 49 | |
Davide Pesavento | e76d7b5 | 2024-04-09 16:54:01 -0400 | [diff] [blame^] | 50 | EXPOSE 6363/tcp 6363/udp 9696/tcp |
Varun Patil | 6ba08cd | 2023-11-18 13:54:52 -0800 | [diff] [blame] | 51 | |
| 52 | ENTRYPOINT ["/usr/bin/nfd"] |
| 53 | CMD ["--config", "/config/nfd.conf"] |