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 | |
| 30 | VOLUME /config |
| 31 | VOLUME /run/nfd |
| 32 | |
| 33 | EXPOSE 6363/tcp |
| 34 | EXPOSE 6363/udp |
| 35 | EXPOSE 9696/tcp |
| 36 | |
| 37 | ENTRYPOINT ["/usr/bin/nfd"] |
| 38 | CMD ["--config", "/config/nfd.conf"] |