| # syntax=docker/dockerfile:1 |
| ARG NDN_CXX_VERSION=latest |
| 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 \ |
| RUN --mount=from=psync,rw,target=/psync <<EOF |
| RUN --mount=rw,target=/src <<EOF |
| touch /deps/debian/control |
| 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 |
| 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 \ |
| ENTRYPOINT ["/usr/bin/nlsr"] |
| CMD ["-f", "/config/nlsr.conf"] |