blob: c2668812a1f2708d8422866bd6728f8fba2cc7ca [file] [log] [blame]
Davide Pesaventoe76d7b52024-04-09 16:54:01 -04001# syntax=docker/dockerfile:1
Varun Patil6ba08cd2023-11-18 13:54:52 -08002
Davide Pesaventoe76d7b52024-04-09 16:54:01 -04003ARG NDN_CXX_VERSION=latest
4FROM ghcr.io/named-data/ndn-cxx-build:${NDN_CXX_VERSION} AS build
5ARG SOURCE_DATE_EPOCH
6
7RUN apt-get install -Uy --no-install-recommends \
8 libpcap-dev \
9 # use 'apt-get distclean' when we upgrade to ubuntu:24.04
Varun Patil6ba08cd2023-11-18 13:54:52 -080010 && rm -rf /var/lib/apt/lists/*
11
Davide Pesavento0f10b162024-04-14 18:12:02 -040012ARG JOBS
Davide Pesaventoe76d7b52024-04-09 16:54:01 -040013RUN --mount=type=bind,rw,target=/src <<EOF
14set -eux
15cd /src
16./waf configure \
17 --prefix=/usr \
18 --libdir=/usr/lib \
19 --sysconfdir=/etc \
20 --localstatedir=/var \
21 --sharedstatedir=/var \
22 --without-systemd
23./waf build
24./waf install
Varun Patil6ba08cd2023-11-18 13:54:52 -080025
Davide Pesaventoe76d7b52024-04-09 16:54:01 -040026mkdir -p /deps/debian
27touch /deps/debian/control
28cd /deps
29for binary in nfd nfdc nfd-autoreg; do
30 dpkg-shlibdeps --ignore-missing-info "/usr/bin/${binary}" -O \
31 | sed -n 's|^shlibs:Depends=||p' | sed 's| ([^)]*),\?||g' > "${binary}"
32done
33EOF
Varun Patil6ba08cd2023-11-18 13:54:52 -080034
Davide Pesavento01d0aa62024-04-12 00:30:05 -040035
36FROM ghcr.io/named-data/ndn-cxx-runtime:${NDN_CXX_VERSION} AS nfd-autoreg
37
38COPY --link --from=build /usr/bin/nfd-autoreg /usr/bin/
39
40RUN --mount=type=bind,from=build,source=/deps,target=/deps \
41 apt-get install -Uy --no-install-recommends $(cat /deps/nfd-autoreg) \
42 && rm -rf /var/lib/apt/lists/*
43
44VOLUME /run/nfd
45
46ENTRYPOINT ["/usr/bin/nfd-autoreg"]
47
48
49FROM ghcr.io/named-data/ndn-cxx-runtime:${NDN_CXX_VERSION} AS nfd-status-http-server
50
51COPY --link --from=build /usr/bin/nfdc /usr/bin/
52COPY --link --from=build /usr/bin/nfd-status-http-server /usr/bin/
53COPY --link --from=build /usr/share/ndn/ /usr/share/ndn/
54
55RUN --mount=type=bind,from=build,source=/deps,target=/deps \
56 apt-get install -Uy --no-install-recommends $(cat /deps/nfdc) \
57 python3 \
58 && rm -rf /var/lib/apt/lists/*
59
60VOLUME /run/nfd
61
62EXPOSE 8080/tcp
63
64ENTRYPOINT ["/usr/bin/nfd-status-http-server", "--address", "0.0.0.0"]
65
66
Davide Pesaventoe76d7b52024-04-09 16:54:01 -040067FROM ghcr.io/named-data/ndn-cxx-runtime:${NDN_CXX_VERSION} AS nfd
Davide Pesavento01d0aa62024-04-12 00:30:05 -040068
69COPY --link --from=build /usr/bin/nfdc /usr/bin/
70COPY --link --from=build /usr/bin/nfd /usr/bin/
71COPY --link --from=build /etc/ndn/nfd.conf.sample /config/nfd.conf
Varun Patil6ba08cd2023-11-18 13:54:52 -080072
Davide Pesaventoe76d7b52024-04-09 16:54:01 -040073RUN --mount=type=bind,from=build,source=/deps,target=/deps \
74 apt-get install -Uy --no-install-recommends $(cat /deps/nfd /deps/nfdc) \
75 && rm -rf /var/lib/apt/lists/*
Varun Patil6ba08cd2023-11-18 13:54:52 -080076
Varun Patil9b877c32023-11-18 17:48:49 -080077ENV HOME=/config
Varun Patil6ba08cd2023-11-18 13:54:52 -080078VOLUME /config
79VOLUME /run/nfd
80
Davide Pesaventoe76d7b52024-04-09 16:54:01 -040081EXPOSE 6363/tcp 6363/udp 9696/tcp
Varun Patil6ba08cd2023-11-18 13:54:52 -080082
83ENTRYPOINT ["/usr/bin/nfd"]
84CMD ["--config", "/config/nfd.conf"]