Varun Patil | 6ba08cd | 2023-11-18 13:54:52 -0800 | [diff] [blame] | 1 | FROM ghcr.io/named-data/ndn-cxx:latest as builder |
| 2 | |
| 3 | RUN apt-get update \ |
| 4 | && apt-get install -y --no-install-recommends libpcap-dev \ |
| 5 | && rm -rf /var/lib/apt/lists/* |
| 6 | |
| 7 | COPY . /NFD |
| 8 | |
| 9 | RUN cd /NFD \ |
| 10 | && ./waf configure --without-pch --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ |
| 11 | && ./waf \ |
| 12 | && ./waf install \ |
| 13 | # get list of dependencies |
| 14 | && mkdir -p /shlibdeps/debian && cd /shlibdeps && touch debian/control \ |
| 15 | && dpkg-shlibdeps --ignore-missing-info /usr/lib/libndn-cxx.so* /usr/bin/nfdc /usr/bin/nfd \ |
| 16 | && sed -n '/^shlibs:Depends=/ s|shlibs:Depends=||p' debian/substvars | sed -e 's|,||g' -e 's| ([^)]*)||g' > /deps.txt |
| 17 | |
| 18 | # use same base distro version as named-data/ndn-cxx |
| 19 | FROM debian:bookworm |
| 20 | |
| 21 | COPY --from=builder /deps.txt / |
| 22 | RUN apt-get update \ |
| 23 | && apt-get install -y --no-install-recommends $(cat /deps.txt) \ |
| 24 | && rm -rf /var/lib/apt/lists/* /deps.txt |
| 25 | |
| 26 | COPY --from=builder /usr/lib/libndn-cxx.so* /usr/lib/ |
| 27 | COPY --from=builder /usr/bin/nfd /usr/bin/ |
| 28 | COPY --from=builder /usr/bin/nfdc /usr/bin/ |
| 29 | |
Varun Patil | 23135a4 | 2023-11-18 15:12:42 -0800 | [diff] [blame] | 30 | COPY --from=builder /usr/bin/nfd-status-http-server /usr/bin/ |
| 31 | COPY --from=builder /usr/share/ndn/ /usr/share/ndn/ |
| 32 | |
Varun Patil | 9b877c3 | 2023-11-18 17:48:49 -0800 | [diff] [blame] | 33 | COPY --from=builder /etc/ndn/nfd.conf.sample /config/nfd.conf |
| 34 | |
| 35 | ENV HOME=/config |
| 36 | |
Varun Patil | 6ba08cd | 2023-11-18 13:54:52 -0800 | [diff] [blame] | 37 | VOLUME /config |
| 38 | VOLUME /run/nfd |
| 39 | |
| 40 | EXPOSE 6363/tcp |
| 41 | EXPOSE 6363/udp |
| 42 | EXPOSE 9696/tcp |
| 43 | |
| 44 | ENTRYPOINT ["/usr/bin/nfd"] |
| 45 | CMD ["--config", "/config/nfd.conf"] |