blob: 3287b1a92effb90ae169ac6b7c900fb6d944c3a8 [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
4
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 \
20 # use 'apt-get distclean' when we upgrade to ubuntu:24.04
Junxiao Shi995c4112023-11-18 19:33:43 +000021 && rm -rf /var/lib/apt/lists/*
22
Davide Pesavento18ccbb32024-03-24 02:16:03 -040023RUN --mount=type=bind,rw,target=/src <<EOF
24set -eux
25cd /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
Junxiao Shi995c4112023-11-18 19:33:43 +000036
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
44FROM ubuntu:23.10 AS run
45
46RUN --mount=type=bind,from=build,source=/deps,target=/deps \
47 apt-get install -Uy --no-install-recommends $(cat /deps/ndn-cxx) \
48 && rm -rf /var/lib/apt/lists/*
49
50RUN --mount=type=bind,from=build,source=/usr,target=/build \
51 cp -av /build/lib/libndn-cxx.so.* /usr/lib/ \
52 && cp -av /build/bin/ndnsec* /usr/bin/