blob: 1d0515a7f9ad41c137c0e008b62c5b484bfc2a5f [file] [log] [blame]
Varun Patil6ba08cd2023-11-18 13:54:52 -08001FROM ghcr.io/named-data/ndn-cxx:latest as builder
2
3RUN apt-get update \
4 && apt-get install -y --no-install-recommends libpcap-dev \
5 && rm -rf /var/lib/apt/lists/*
6
7COPY . /NFD
8
9RUN 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
19FROM debian:bookworm
20
21COPY --from=builder /deps.txt /
22RUN apt-get update \
23 && apt-get install -y --no-install-recommends $(cat /deps.txt) \
24 && rm -rf /var/lib/apt/lists/* /deps.txt
25
26COPY --from=builder /usr/lib/libndn-cxx.so* /usr/lib/
27COPY --from=builder /usr/bin/nfd /usr/bin/
28COPY --from=builder /usr/bin/nfdc /usr/bin/
29
30VOLUME /config
31VOLUME /run/nfd
32
33EXPOSE 6363/tcp
34EXPOSE 6363/udp
35EXPOSE 9696/tcp
36
37ENTRYPOINT ["/usr/bin/nfd"]
38CMD ["--config", "/config/nfd.conf"]