blob: 1b53e3b7a64cb06e66ca27ee10c4b3704400669a [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 Pesaventoe76d7b52024-04-09 16:54:01 -040034FROM ghcr.io/named-data/ndn-cxx-runtime:${NDN_CXX_VERSION} AS nfd
35ARG SOURCE_DATE_EPOCH
Varun Patil6ba08cd2023-11-18 13:54:52 -080036
Davide Pesaventoe76d7b52024-04-09 16:54:01 -040037RUN --mount=type=bind,from=build,source=/deps,target=/deps \
38 apt-get install -Uy --no-install-recommends $(cat /deps/nfd /deps/nfdc) \
39 && rm -rf /var/lib/apt/lists/*
Varun Patil6ba08cd2023-11-18 13:54:52 -080040
Davide Pesaventoe76d7b52024-04-09 16:54:01 -040041COPY --link --from=build /usr/bin/nfd /usr/bin/
42COPY --link --from=build /usr/bin/nfdc /usr/bin/
43COPY --link --from=build /etc/ndn/nfd.conf.sample /config/nfd.conf
Varun Patil9b877c32023-11-18 17:48:49 -080044
45ENV HOME=/config
46
Varun Patil6ba08cd2023-11-18 13:54:52 -080047VOLUME /config
48VOLUME /run/nfd
49
Davide Pesaventoe76d7b52024-04-09 16:54:01 -040050EXPOSE 6363/tcp 6363/udp 9696/tcp
Varun Patil6ba08cd2023-11-18 13:54:52 -080051
52ENTRYPOINT ["/usr/bin/nfd"]
53CMD ["--config", "/config/nfd.conf"]