blob: c5833b6356c8f3af36da840f6017a6fa66b05808 [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 Pesavento18ccbb32024-03-24 02:16:03 -040025set -eux
26cd /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
Davide Pesavento18ccbb32024-03-24 02:16:03 -040037mkdir -p /deps/debian
38touch /deps/debian/control
39cd /deps
40dpkg-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
42EOF
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 Pesavento18ccbb32024-03-24 02:16:03 -040048 apt-get install -Uy --no-install-recommends $(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/