blob: 0a917e4646437361f8e188e8d551c4c93d039f3c [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
Varun Patil23135a42023-11-18 15:12:42 -080030COPY --from=builder /usr/bin/nfd-status-http-server /usr/bin/
31COPY --from=builder /usr/share/ndn/ /usr/share/ndn/
32
Varun Patil9b877c32023-11-18 17:48:49 -080033COPY --from=builder /etc/ndn/nfd.conf.sample /config/nfd.conf
34
35ENV HOME=/config
36
Varun Patil6ba08cd2023-11-18 13:54:52 -080037VOLUME /config
38VOLUME /run/nfd
39
40EXPOSE 6363/tcp
41EXPOSE 6363/udp
42EXPOSE 9696/tcp
43
44ENTRYPOINT ["/usr/bin/nfd"]
45CMD ["--config", "/config/nfd.conf"]