blob: 9906703c4e31d1d6a7c1cdf20331cac237ad3986 [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-log-dev \
12 libboost-program-options-dev \
Junxiao Shi995c4112023-11-18 19:33:43 +000013 libboost-stacktrace-dev \
Davide Pesaventoe3710032024-02-05 19:57:05 -050014 libboost-thread-dev \
Davide Pesavento18ccbb32024-03-24 02:16:03 -040015 libsqlite3-dev \
16 libssl-dev \
17 pkgconf \
18 python3 \
Davide Pesavento5eb7a072024-05-03 16:52:23 -040019 && apt-get distclean
Junxiao Shi995c4112023-11-18 19:33:43 +000020
Davide Pesavento84667172024-04-14 14:00:44 -040021ARG JOBS
Davide Pesavento5eb7a072024-05-03 16:52:23 -040022ARG SOURCE_DATE_EPOCH
23RUN --mount=rw,target=/src <<EOF
Davide Pesavento2be774b2024-06-07 17:25:31 -040024 set -eux
25 cd /src
26 ./waf configure \
27 --prefix=/usr \
28 --libdir=/usr/lib \
29 --sysconfdir=/etc \
30 --localstatedir=/var \
31 --sharedstatedir=/var \
32 --disable-static \
33 --enable-shared
34 ./waf build
35 ./waf install
36 mkdir -p /deps/debian
37 touch /deps/debian/control
38 cd /deps
39 dpkg-shlibdeps --ignore-missing-info /usr/lib/libndn-cxx.so.* /usr/bin/ndnsec -O \
40 | sed -n 's|^shlibs:Depends=||p' | sed 's| ([^)]*),\?||g' > ndn-cxx
Davide Pesavento18ccbb32024-03-24 02:16:03 -040041EOF
42
Davide Pesavento18ccbb32024-03-24 02:16:03 -040043
Davide Pesavento5eb7a072024-05-03 16:52:23 -040044FROM ubuntu:24.04 AS runtime
45
46RUN --mount=from=build,source=/deps,target=/deps \
Davide Pesavento2be774b2024-06-07 17:25:31 -040047 apt-get install -Uy --no-install-recommends \
48 $(cat /deps/ndn-cxx) \
Davide Pesavento5eb7a072024-05-03 16:52:23 -040049 && apt-get distclean
Davide Pesavento18ccbb32024-03-24 02:16:03 -040050
Davide Pesavento5eb7a072024-05-03 16:52:23 -040051RUN --mount=from=build,source=/usr,target=/build \
Davide Pesavento18ccbb32024-03-24 02:16:03 -040052 cp -av /build/lib/libndn-cxx.so.* /usr/lib/ \
53 && cp -av /build/bin/ndnsec* /usr/bin/