Davide Pesavento | 18ccbb3 | 2024-03-24 02:16:03 -0400 | [diff] [blame] | 1 | # syntax=docker/dockerfile:1 |
Junxiao Shi | 995c411 | 2023-11-18 19:33:43 +0000 | [diff] [blame] | 2 | |
Davide Pesavento | 18ccbb3 | 2024-03-24 02:16:03 -0400 | [diff] [blame] | 3 | FROM ubuntu:23.10 AS build |
| 4 | |
| 5 | RUN apt-get install -Uy --no-install-recommends \ |
Junxiao Shi | 995c411 | 2023-11-18 19:33:43 +0000 | [diff] [blame] | 6 | dpkg-dev \ |
Davide Pesavento | 18ccbb3 | 2024-03-24 02:16:03 -0400 | [diff] [blame] | 7 | g++ \ |
| 8 | git \ |
Junxiao Shi | 995c411 | 2023-11-18 19:33:43 +0000 | [diff] [blame] | 9 | libboost-chrono-dev \ |
Davide Pesavento | e371003 | 2024-02-05 19:57:05 -0500 | [diff] [blame] | 10 | libboost-dev \ |
Junxiao Shi | 995c411 | 2023-11-18 19:33:43 +0000 | [diff] [blame] | 11 | libboost-filesystem-dev \ |
Junxiao Shi | 995c411 | 2023-11-18 19:33:43 +0000 | [diff] [blame] | 12 | libboost-log-dev \ |
| 13 | libboost-program-options-dev \ |
Junxiao Shi | 995c411 | 2023-11-18 19:33:43 +0000 | [diff] [blame] | 14 | libboost-stacktrace-dev \ |
Davide Pesavento | e371003 | 2024-02-05 19:57:05 -0500 | [diff] [blame] | 15 | libboost-thread-dev \ |
Davide Pesavento | 18ccbb3 | 2024-03-24 02:16:03 -0400 | [diff] [blame] | 16 | libsqlite3-dev \ |
| 17 | libssl-dev \ |
| 18 | pkgconf \ |
| 19 | python3 \ |
| 20 | # use 'apt-get distclean' when we upgrade to ubuntu:24.04 |
Junxiao Shi | 995c411 | 2023-11-18 19:33:43 +0000 | [diff] [blame] | 21 | && rm -rf /var/lib/apt/lists/* |
| 22 | |
Davide Pesavento | 18ccbb3 | 2024-03-24 02:16:03 -0400 | [diff] [blame] | 23 | RUN --mount=type=bind,rw,target=/src <<EOF |
| 24 | 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 |
Junxiao Shi | 995c411 | 2023-11-18 19:33:43 +0000 | [diff] [blame] | 36 | |
Davide Pesavento | 18ccbb3 | 2024-03-24 02:16:03 -0400 | [diff] [blame] | 37 | mkdir -p /deps/debian |
| 38 | touch /deps/debian/control |
| 39 | cd /deps |
| 40 | dpkg-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 |
| 42 | EOF |
| 43 | |
| 44 | FROM ubuntu:23.10 AS run |
| 45 | |
| 46 | RUN --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 | |
| 50 | RUN --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/ |