blob: 9d73d0b78f1def92182116ada68bc5b80f86a255 [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 Pesavento18ccbb32024-03-24 02:16:03 -040024RUN --mount=type=bind,rw,target=/src <<EOF
25set -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
Junxiao Shi995c4112023-11-18 19:33:43 +000037
Davide Pesavento18ccbb32024-03-24 02:16:03 -040038mkdir -p /deps/debian
39touch /deps/debian/control
40cd /deps
41dpkg-shlibdeps --ignore-missing-info /usr/lib/libndn-cxx.so.* /usr/bin/ndnsec -O \
42 | sed -n 's|^shlibs:Depends=||p' | sed 's| ([^)]*),\?||g' > ndn-cxx
43EOF
44
Davide Pesavento4b3aa4f2024-04-06 22:00:10 -040045FROM ubuntu:23.10 AS runtime
46ARG SOURCE_DATE_EPOCH
Davide Pesavento18ccbb32024-03-24 02:16:03 -040047
48RUN --mount=type=bind,from=build,source=/deps,target=/deps \
49 apt-get install -Uy --no-install-recommends $(cat /deps/ndn-cxx) \
50 && rm -rf /var/lib/apt/lists/*
51
52RUN --mount=type=bind,from=build,source=/usr,target=/build \
53 cp -av /build/lib/libndn-cxx.so.* /usr/lib/ \
54 && cp -av /build/bin/ndnsec* /usr/bin/