blob: 5ade25abd72ed7f17746a8ea7883811267030a6b [file] [log] [blame]
Davide Pesavento18ccbb32024-03-24 02:16:03 -04001# syntax=docker/dockerfile:1
Junxiao Shi995c4112023-11-18 19:33:43 +00002
Davide Pesavento5eb7a072024-05-03 16:52:23 -04003FROM ubuntu:24.04 AS build
Davide Pesavento18ccbb32024-03-24 02:16:03 -04004
5RUN apt-get install -Uy --no-install-recommends \
Junxiao Shi995c4112023-11-18 19:33:43 +00006 dpkg-dev \
Davide Pesavento18ccbb32024-03-24 02:16:03 -04007 g++ \
8 git \
Junxiao Shi995c4112023-11-18 19:33:43 +00009 libboost-chrono-dev \
Davide Pesaventoe3710032024-02-05 19:57:05 -050010 libboost-dev \
Junxiao Shi995c4112023-11-18 19:33:43 +000011 libboost-filesystem-dev \
Junxiao Shi995c4112023-11-18 19:33:43 +000012 libboost-log-dev \
13 libboost-program-options-dev \
Junxiao Shi995c4112023-11-18 19:33:43 +000014 libboost-stacktrace-dev \
Davide Pesaventoe3710032024-02-05 19:57:05 -050015 libboost-thread-dev \
Davide Pesavento18ccbb32024-03-24 02:16:03 -040016 libsqlite3-dev \
17 libssl-dev \
18 pkgconf \
19 python3 \
Davide Pesavento5eb7a072024-05-03 16:52:23 -040020 && apt-get distclean
Junxiao Shi995c4112023-11-18 19:33:43 +000021
Davide Pesavento84667172024-04-14 14:00:44 -040022ARG JOBS
Davide Pesavento5eb7a072024-05-03 16:52:23 -040023ARG SOURCE_DATE_EPOCH
24RUN --mount=rw,target=/src <<EOF
Davide Pesavento2be774b2024-06-07 17:25:31 -040025 set -eux
26 cd /src
27 ./waf configure \
28 --prefix=/usr \
29 --libdir=/usr/lib \
30 --sysconfdir=/etc \
31 --localstatedir=/var \
32 --sharedstatedir=/var \
33 --disable-static \
34 --enable-shared
35 ./waf build
36 ./waf install
37 mkdir -p /deps/debian
38 touch /deps/debian/control
39 cd /deps
40 dpkg-shlibdeps --ignore-missing-info /usr/lib/libndn-cxx.so.* /usr/bin/ndnsec -O \
41 | sed -n 's|^shlibs:Depends=||p' | sed 's| ([^)]*),\?||g' > ndn-cxx
Davide Pesavento18ccbb32024-03-24 02:16:03 -040042EOF
43
Davide Pesavento18ccbb32024-03-24 02:16:03 -040044
Davide Pesavento5eb7a072024-05-03 16:52:23 -040045FROM ubuntu:24.04 AS runtime
46
47RUN --mount=from=build,source=/deps,target=/deps \
Davide Pesavento2be774b2024-06-07 17:25:31 -040048 apt-get install -Uy --no-install-recommends \
49 $(cat /deps/ndn-cxx) \
Davide Pesavento5eb7a072024-05-03 16:52:23 -040050 && apt-get distclean
Davide Pesavento18ccbb32024-03-24 02:16:03 -040051
Davide Pesavento5eb7a072024-05-03 16:52:23 -040052RUN --mount=from=build,source=/usr,target=/build \
Davide Pesavento18ccbb32024-03-24 02:16:03 -040053 cp -av /build/lib/libndn-cxx.so.* /usr/lib/ \
54 && cp -av /build/bin/ndnsec* /usr/bin/