blob: 17a0a75e6077fe53ca0e7b651febb368b34554da [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 Pesaventoe76d7b52024-04-09 16:54:01 -040013set -eux
14cd /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
Davide Pesaventoe76d7b52024-04-09 16:54:01 -040024mkdir -p /deps/debian
25touch /deps/debian/control
26cd /deps
27for binary in nfd nfdc nfd-autoreg; do
28 dpkg-shlibdeps --ignore-missing-info "/usr/bin/${binary}" -O \
29 | sed -n 's|^shlibs:Depends=||p' | sed 's| ([^)]*),\?||g' > "${binary}"
30done
31EOF
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
Davide Pesaventoc3bf8ad2024-05-03 20:20:54 -040038RUN --mount=from=build,source=/deps,target=/deps \
Davide Pesavento01d0aa62024-04-12 00:30:05 -040039 apt-get install -Uy --no-install-recommends $(cat /deps/nfd-autoreg) \
Davide Pesaventoc3bf8ad2024-05-03 20:20:54 -040040 && apt-get distclean
Davide Pesavento01d0aa62024-04-12 00:30:05 -040041
Varun Patilec352f22024-05-06 17:23:12 -070042ENV HOME=/config
43VOLUME /config
Davide Pesavento01d0aa62024-04-12 00:30:05 -040044VOLUME /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
Davide Pesaventoc3bf8ad2024-05-03 20:20:54 -040055RUN --mount=from=build,source=/deps,target=/deps \
Davide Pesavento01d0aa62024-04-12 00:30:05 -040056 apt-get install -Uy --no-install-recommends $(cat /deps/nfdc) \
57 python3 \
Davide Pesaventoc3bf8ad2024-05-03 20:20:54 -040058 && apt-get distclean
Davide Pesavento01d0aa62024-04-12 00:30:05 -040059
Varun Patilec352f22024-05-06 17:23:12 -070060ENV HOME=/config
61VOLUME /config
Davide Pesavento01d0aa62024-04-12 00:30:05 -040062VOLUME /run/nfd
63
64EXPOSE 8080/tcp
65
66ENTRYPOINT ["/usr/bin/nfd-status-http-server", "--address", "0.0.0.0"]
67
68
Davide Pesaventoe76d7b52024-04-09 16:54:01 -040069FROM ghcr.io/named-data/ndn-cxx-runtime:${NDN_CXX_VERSION} AS nfd
Davide Pesavento01d0aa62024-04-12 00:30:05 -040070
71COPY --link --from=build /usr/bin/nfdc /usr/bin/
72COPY --link --from=build /usr/bin/nfd /usr/bin/
73COPY --link --from=build /etc/ndn/nfd.conf.sample /config/nfd.conf
Varun Patil6ba08cd2023-11-18 13:54:52 -080074
Davide Pesaventoc3bf8ad2024-05-03 20:20:54 -040075RUN --mount=from=build,source=/deps,target=/deps \
Davide Pesaventoe76d7b52024-04-09 16:54:01 -040076 apt-get install -Uy --no-install-recommends $(cat /deps/nfd /deps/nfdc) \
Davide Pesaventoc3bf8ad2024-05-03 20:20:54 -040077 && apt-get distclean
Varun Patil6ba08cd2023-11-18 13:54:52 -080078
Varun Patil9b877c32023-11-18 17:48:49 -080079ENV HOME=/config
Varun Patil6ba08cd2023-11-18 13:54:52 -080080VOLUME /config
81VOLUME /run/nfd
82
Davide Pesaventoe76d7b52024-04-09 16:54:01 -040083EXPOSE 6363/tcp 6363/udp 9696/tcp
Varun Patil6ba08cd2023-11-18 13:54:52 -080084
85ENTRYPOINT ["/usr/bin/nfd"]
86CMD ["--config", "/config/nfd.conf"]