blob: b8fa4e5e2a3900f12a042d6bf6d0fd51e72b8758 [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
Davide Pesaventoe76d7b52024-04-09 16:54:01 -04005
6RUN apt-get install -Uy --no-install-recommends \
7 libpcap-dev \
Davide Pesaventoc3bf8ad2024-05-03 20:20:54 -04008 && apt-get distclean
Varun Patil6ba08cd2023-11-18 13:54:52 -08009
Davide Pesavento0f10b162024-04-14 18:12:02 -040010ARG JOBS
Davide Pesaventoc3bf8ad2024-05-03 20:20:54 -040011ARG SOURCE_DATE_EPOCH
12RUN --mount=rw,target=/src <<EOF
Davide Pesavento48108e02024-05-13 19:04:25 -040013 set -eux
14 cd /src
15 ./waf configure \
16 --prefix=/usr \
17 --libdir=/usr/lib \
18 --sysconfdir=/etc \
19 --localstatedir=/var \
20 --sharedstatedir=/var \
21 --without-systemd
22 ./waf build
23 ./waf install
24 mkdir -p /deps/debian
25 touch /deps/debian/control
26 cd /deps
27 for binary in nfd nfdc; do
28 dpkg-shlibdeps --ignore-missing-info "/usr/bin/${binary}" -O \
29 | sed -n 's|^shlibs:Depends=||p' | sed 's| ([^)]*),\?||g' > "${binary}"
30 done
Davide Pesaventoe76d7b52024-04-09 16:54:01 -040031EOF
Varun Patil6ba08cd2023-11-18 13:54:52 -080032
Davide Pesavento01d0aa62024-04-12 00:30:05 -040033
34FROM ghcr.io/named-data/ndn-cxx-runtime:${NDN_CXX_VERSION} AS nfd-autoreg
35
36COPY --link --from=build /usr/bin/nfd-autoreg /usr/bin/
37
Varun Patilec352f22024-05-06 17:23:12 -070038ENV HOME=/config
39VOLUME /config
Davide Pesavento01d0aa62024-04-12 00:30:05 -040040VOLUME /run/nfd
41
42ENTRYPOINT ["/usr/bin/nfd-autoreg"]
43
44
45FROM ghcr.io/named-data/ndn-cxx-runtime:${NDN_CXX_VERSION} AS nfd-status-http-server
46
47COPY --link --from=build /usr/bin/nfdc /usr/bin/
48COPY --link --from=build /usr/bin/nfd-status-http-server /usr/bin/
49COPY --link --from=build /usr/share/ndn/ /usr/share/ndn/
50
Davide Pesaventoc3bf8ad2024-05-03 20:20:54 -040051RUN --mount=from=build,source=/deps,target=/deps \
Davide Pesavento48108e02024-05-13 19:04:25 -040052 apt-get install -Uy --no-install-recommends \
53 $(cat /deps/nfdc) \
Davide Pesavento01d0aa62024-04-12 00:30:05 -040054 python3 \
Davide Pesaventoc3bf8ad2024-05-03 20:20:54 -040055 && apt-get distclean
Davide Pesavento01d0aa62024-04-12 00:30:05 -040056
Varun Patilec352f22024-05-06 17:23:12 -070057ENV HOME=/config
58VOLUME /config
Davide Pesavento01d0aa62024-04-12 00:30:05 -040059VOLUME /run/nfd
60
Davide Pesavento48108e02024-05-13 19:04:25 -040061EXPOSE 6380/tcp
Davide Pesavento01d0aa62024-04-12 00:30:05 -040062
63ENTRYPOINT ["/usr/bin/nfd-status-http-server", "--address", "0.0.0.0"]
64
65
Davide Pesaventoe76d7b52024-04-09 16:54:01 -040066FROM ghcr.io/named-data/ndn-cxx-runtime:${NDN_CXX_VERSION} AS nfd
Davide Pesavento01d0aa62024-04-12 00:30:05 -040067
68COPY --link --from=build /usr/bin/nfdc /usr/bin/
69COPY --link --from=build /usr/bin/nfd /usr/bin/
70COPY --link --from=build /etc/ndn/nfd.conf.sample /config/nfd.conf
Varun Patil6ba08cd2023-11-18 13:54:52 -080071
Davide Pesaventoc3bf8ad2024-05-03 20:20:54 -040072RUN --mount=from=build,source=/deps,target=/deps \
Davide Pesavento48108e02024-05-13 19:04:25 -040073 apt-get install -Uy --no-install-recommends \
74 $(cat /deps/nfd /deps/nfdc) \
Davide Pesaventoc3bf8ad2024-05-03 20:20:54 -040075 && apt-get distclean
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"]