-
Notifications
You must be signed in to change notification settings - Fork 37
/
Dockerfile
67 lines (56 loc) · 1.71 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
# syntax=docker/dockerfile:1
ARG NDN_CXX_VERSION=latest
FROM scratch AS psync
ARG PSYNC_VERSION=master
ADD https://github.com/named-data/PSync.git#${PSYNC_VERSION} /
FROM ghcr.io/named-data/ndn-cxx-build:${NDN_CXX_VERSION} AS build
RUN apt-get install -Uy --no-install-recommends \
libboost-iostreams-dev \
&& apt-get distclean
ARG JOBS
ARG SOURCE_DATE_EPOCH
RUN --mount=from=psync,rw,target=/psync <<EOF
set -eux
cd /psync
./waf configure \
--prefix=/usr \
--libdir=/usr/lib \
--sysconfdir=/etc \
--localstatedir=/var \
--sharedstatedir=/var
./waf build
./waf install
EOF
RUN --mount=rw,target=/src <<EOF
set -eux
cd /src
./waf configure \
--prefix=/usr \
--libdir=/usr/lib \
--sysconfdir=/etc \
--localstatedir=/var \
--sharedstatedir=/var \
--with-psync
./waf build
./waf install
mkdir -p /deps/debian
touch /deps/debian/control
cd /deps
dpkg-shlibdeps --ignore-missing-info /usr/lib/libPSync.so.* /usr/bin/nlsr /usr/bin/nlsrc -O \
| sed -n 's|^shlibs:Depends=||p' | sed 's| ([^)]*),\?||g' > nlsr
EOF
FROM ghcr.io/named-data/ndn-cxx-runtime:${NDN_CXX_VERSION} AS nlsr
COPY --link --from=build /usr/lib/libPSync.so.* /usr/lib/
COPY --link --from=build /usr/bin/nlsr /usr/bin/
COPY --link --from=build /usr/bin/nlsrc /usr/bin/
COPY --link --from=build /etc/ndn/nlsr.conf.sample /config/nlsr.conf
RUN --mount=from=build,source=/deps,target=/deps \
apt-get install -Uy --no-install-recommends \
$(cat /deps/nlsr) \
&& apt-get distclean
ENV HOME=/config
VOLUME /config
VOLUME /var/lib/nlsr
VOLUME /run/nfd
ENTRYPOINT ["/usr/bin/nlsr"]
CMD ["-f", "/config/nlsr.conf"]