blob: 14a5c65d9358592ee3f98e7b53429adccad43703 [file] [log] [blame]
Davide Pesavento18ccbb32024-03-24 02:16:03 -04001# syntax=docker/dockerfile:1
Junxiao Shi995c4112023-11-18 19:33:43 +00002
Davide Pesavento18ccbb32024-03-24 02:16:03 -04003FROM ubuntu:23.10 AS build
Davide Pesavento4b3aa4f2024-04-06 22:00:10 -04004ARG SOURCE_DATE_EPOCH
Davide Pesavento18ccbb32024-03-24 02:16:03 -04005
6RUN apt-get install -Uy --no-install-recommends \
Junxiao Shi995c4112023-11-18 19:33:43 +00007 dpkg-dev \
Davide Pesavento18ccbb32024-03-24 02:16:03 -04008 g++ \
9 git \
Junxiao Shi995c4112023-11-18 19:33:43 +000010 libboost-chrono-dev \
Davide Pesaventoe3710032024-02-05 19:57:05 -050011 libboost-dev \
Junxiao Shi995c4112023-11-18 19:33:43 +000012 libboost-filesystem-dev \
Junxiao Shi995c4112023-11-18 19:33:43 +000013 libboost-log-dev \
14 libboost-program-options-dev \
Junxiao Shi995c4112023-11-18 19:33:43 +000015 libboost-stacktrace-dev \
Davide Pesaventoe3710032024-02-05 19:57:05 -050016 libboost-thread-dev \
Davide Pesavento18ccbb32024-03-24 02:16:03 -040017 libsqlite3-dev \
18 libssl-dev \
19 pkgconf \
20 python3 \
21 # use 'apt-get distclean' when we upgrade to ubuntu:24.04
Junxiao Shi995c4112023-11-18 19:33:43 +000022 && rm -rf /var/lib/apt/lists/*
23
Davide Pesavento84667172024-04-14 14:00:44 -040024ARG JOBS
Davide Pesavento18ccbb32024-03-24 02:16:03 -040025RUN --mount=type=bind,rw,target=/src <<EOF
26set -eux
27cd /src
28./waf configure \
29 --prefix=/usr \
30 --libdir=/usr/lib \
31 --sysconfdir=/etc \
32 --localstatedir=/var \
33 --sharedstatedir=/var \
34 --disable-static \
35 --enable-shared
36./waf build
37./waf install
Junxiao Shi995c4112023-11-18 19:33:43 +000038
Davide Pesavento18ccbb32024-03-24 02:16:03 -040039mkdir -p /deps/debian
40touch /deps/debian/control
41cd /deps
42dpkg-shlibdeps --ignore-missing-info /usr/lib/libndn-cxx.so.* /usr/bin/ndnsec -O \
43 | sed -n 's|^shlibs:Depends=||p' | sed 's| ([^)]*),\?||g' > ndn-cxx
44EOF
45
Davide Pesavento4b3aa4f2024-04-06 22:00:10 -040046FROM ubuntu:23.10 AS runtime
47ARG SOURCE_DATE_EPOCH
Davide Pesavento18ccbb32024-03-24 02:16:03 -040048
49RUN --mount=type=bind,from=build,source=/deps,target=/deps \
50 apt-get install -Uy --no-install-recommends $(cat /deps/ndn-cxx) \
51 && rm -rf /var/lib/apt/lists/*
52
53RUN --mount=type=bind,from=build,source=/usr,target=/build \
54 cp -av /build/lib/libndn-cxx.so.* /usr/lib/ \
55 && cp -av /build/bin/ndnsec* /usr/bin/