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