blob: 0409463b739fcd870563a2cef485a01c4b910013 [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 Pesaventoe76d7b52024-04-09 16:54:01 -040012RUN --mount=type=bind,rw,target=/src <<EOF
13set -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
Varun Patil6ba08cd2023-11-18 13:54:52 -080024
Davide Pesaventoe76d7b52024-04-09 16:54:01 -040025mkdir -p /deps/debian
26touch /deps/debian/control
27cd /deps
28for binary in nfd nfdc nfd-autoreg; do
29 dpkg-shlibdeps --ignore-missing-info "/usr/bin/${binary}" -O \
30 | sed -n 's|^shlibs:Depends=||p' | sed 's| ([^)]*),\?||g' > "${binary}"
31done
32EOF
Varun Patil6ba08cd2023-11-18 13:54:52 -080033
Davide Pesavento01d0aa62024-04-12 00:30:05 -040034
35FROM ghcr.io/named-data/ndn-cxx-runtime:${NDN_CXX_VERSION} AS nfd-autoreg
36
37COPY --link --from=build /usr/bin/nfd-autoreg /usr/bin/
38
39RUN --mount=type=bind,from=build,source=/deps,target=/deps \
40 apt-get install -Uy --no-install-recommends $(cat /deps/nfd-autoreg) \
41 && rm -rf /var/lib/apt/lists/*
42
43VOLUME /run/nfd
44
45ENTRYPOINT ["/usr/bin/nfd-autoreg"]
46
47
48FROM ghcr.io/named-data/ndn-cxx-runtime:${NDN_CXX_VERSION} AS nfd-status-http-server
49
50COPY --link --from=build /usr/bin/nfdc /usr/bin/
51COPY --link --from=build /usr/bin/nfd-status-http-server /usr/bin/
52COPY --link --from=build /usr/share/ndn/ /usr/share/ndn/
53
54RUN --mount=type=bind,from=build,source=/deps,target=/deps \
55 apt-get install -Uy --no-install-recommends $(cat /deps/nfdc) \
56 python3 \
57 && rm -rf /var/lib/apt/lists/*
58
59VOLUME /run/nfd
60
61EXPOSE 8080/tcp
62
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 Pesaventoe76d7b52024-04-09 16:54:01 -040072RUN --mount=type=bind,from=build,source=/deps,target=/deps \
73 apt-get install -Uy --no-install-recommends $(cat /deps/nfd /deps/nfdc) \
74 && rm -rf /var/lib/apt/lists/*
Varun Patil6ba08cd2023-11-18 13:54:52 -080075
Varun Patil9b877c32023-11-18 17:48:49 -080076ENV HOME=/config
Varun Patil6ba08cd2023-11-18 13:54:52 -080077VOLUME /config
78VOLUME /run/nfd
79
Davide Pesaventoe76d7b52024-04-09 16:54:01 -040080EXPOSE 6363/tcp 6363/udp 9696/tcp
Varun Patil6ba08cd2023-11-18 13:54:52 -080081
82ENTRYPOINT ["/usr/bin/nfd"]
83CMD ["--config", "/config/nfd.conf"]