blob: 99bcb887727c507991181e5169cf053153571c46 [file] [log] [blame]
Varun Patil35e6aff2024-05-04 14:14:06 -07001# syntax=docker/dockerfile:1
2
3ARG NDN_CXX_VERSION=latest
4FROM ghcr.io/named-data/ndn-cxx-build:${NDN_CXX_VERSION} AS build
5
6RUN apt-get install -Uy --no-install-recommends \
7 libpcap-dev \
8 && apt-get distclean
9
10ARG JOBS
11ARG SOURCE_DATE_EPOCH
12RUN --mount=rw,target=/src <<EOF
13 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 ./waf build
22 ./waf install
23 mkdir -p /deps/debian
24 touch /deps/debian/control
25 cd /deps
26 for binary in ndnpeek ndnpoke ndncatchunks ndnputchunks ndnping ndnpingserver ndndump ndn-dissect; do
27 dpkg-shlibdeps --ignore-missing-info "/usr/bin/${binary}" -O \
28 | sed -n 's|^shlibs:Depends=||p' | sed 's| ([^)]*),\?||g' > "${binary}"
29 done
30EOF
31
32
33FROM ghcr.io/named-data/ndn-cxx-runtime:${NDN_CXX_VERSION} AS ndn-tools
34
35COPY --link --from=build /usr/bin/ndnpeek /usr/bin/
36COPY --link --from=build /usr/bin/ndnpoke /usr/bin/
37COPY --link --from=build /usr/bin/ndncatchunks /usr/bin/
38COPY --link --from=build /usr/bin/ndnputchunks /usr/bin/
39COPY --link --from=build /usr/bin/ndnping /usr/bin/
40COPY --link --from=build /usr/bin/ndnpingserver /usr/bin/
41COPY --link --from=build /usr/bin/ndndump /usr/bin/
42COPY --link --from=build /usr/bin/ndn-dissect /usr/bin/
43
44RUN --mount=from=build,source=/deps,target=/deps \
Davide Pesavento5b71cfa2024-06-07 17:44:06 -040045 apt-get install -Uy --no-install-recommends \
46 $(cat /deps/ndn*) \
Varun Patil35e6aff2024-05-04 14:14:06 -070047 && apt-get distclean
48
49ENV HOME=/config
50VOLUME /config
51VOLUME /run/nfd