-
Notifications
You must be signed in to change notification settings - Fork 154
/
Dockerfile
84 lines (62 loc) · 2.09 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# syntax=docker/dockerfile:1
ARG NDN_CXX_VERSION=latest
FROM ghcr.io/named-data/ndn-cxx-build:${NDN_CXX_VERSION} AS build
RUN apt-get install -Uy --no-install-recommends \
libpcap-dev \
&& apt-get distclean
ARG JOBS
ARG SOURCE_DATE_EPOCH
RUN --mount=rw,target=/src <<EOF
set -eux
cd /src
./waf configure \
--prefix=/usr \
--libdir=/usr/lib \
--sysconfdir=/etc \
--localstatedir=/var \
--sharedstatedir=/var \
--without-systemd
./waf build
./waf install
mkdir -p /deps/debian
touch /deps/debian/control
cd /deps
for binary in nfd nfdc; do
dpkg-shlibdeps --ignore-missing-info "/usr/bin/${binary}" -O \
| sed -n 's|^shlibs:Depends=||p' | sed 's| ([^)]*),\?||g' > "${binary}"
done
EOF
FROM ghcr.io/named-data/ndn-cxx-runtime:${NDN_CXX_VERSION} AS nfd-autoreg
COPY --link --from=build /usr/bin/nfd-autoreg /usr/bin/
ENV HOME=/config
VOLUME /config
VOLUME /run/nfd
ENTRYPOINT ["/usr/bin/nfd-autoreg"]
FROM ghcr.io/named-data/ndn-cxx-runtime:${NDN_CXX_VERSION} AS nfd-status-http-server
COPY --link --from=build /usr/bin/nfdc /usr/bin/
COPY --link --from=build /usr/bin/nfd-status-http-server /usr/bin/
COPY --link --from=build /usr/share/ndn/ /usr/share/ndn/
RUN --mount=from=build,source=/deps,target=/deps \
apt-get install -Uy --no-install-recommends \
$(cat /deps/nfdc) \
python3 \
&& apt-get distclean
ENV HOME=/config
VOLUME /config
VOLUME /run/nfd
EXPOSE 6380/tcp
ENTRYPOINT ["/usr/bin/nfd-status-http-server", "--address", "0.0.0.0"]
FROM ghcr.io/named-data/ndn-cxx-runtime:${NDN_CXX_VERSION} AS nfd
COPY --link --from=build /usr/bin/nfdc /usr/bin/
COPY --link --from=build /usr/bin/nfd /usr/bin/
COPY --link --from=build /etc/ndn/nfd.conf.sample /config/nfd.conf
RUN --mount=from=build,source=/deps,target=/deps \
apt-get install -Uy --no-install-recommends \
$(cat /deps/nfd /deps/nfdc) \
&& apt-get distclean
ENV HOME=/config
VOLUME /config
VOLUME /run/nfd
EXPOSE 6363/tcp 6363/udp 9696/tcp
ENTRYPOINT ["/usr/bin/nfd"]
CMD ["--config", "/config/nfd.conf"]