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 | 5eb7a07 | 2024-05-03 16:52:23 -0400 | [diff] [blame] | 3 | FROM ubuntu:24.04 AS build |
Davide Pesavento | 18ccbb3 | 2024-03-24 02:16:03 -0400 | [diff] [blame] | 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 \ |
Davide Pesavento | 5eb7a07 | 2024-05-03 16:52:23 -0400 | [diff] [blame] | 20 | && apt-get distclean |
Junxiao Shi | 995c411 | 2023-11-18 19:33:43 +0000 | [diff] [blame] | 21 | |
Davide Pesavento | 8466717 | 2024-04-14 14:00:44 -0400 | [diff] [blame] | 22 | ARG JOBS |
Davide Pesavento | 5eb7a07 | 2024-05-03 16:52:23 -0400 | [diff] [blame] | 23 | ARG SOURCE_DATE_EPOCH |
| 24 | RUN --mount=rw,target=/src <<EOF |
Davide Pesavento | 18ccbb3 | 2024-03-24 02:16:03 -0400 | [diff] [blame] | 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 |
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 | |
Davide Pesavento | 18ccbb3 | 2024-03-24 02:16:03 -0400 | [diff] [blame] | 44 | |
Davide Pesavento | 5eb7a07 | 2024-05-03 16:52:23 -0400 | [diff] [blame] | 45 | FROM ubuntu:24.04 AS runtime |
| 46 | |
| 47 | RUN --mount=from=build,source=/deps,target=/deps \ |
Davide Pesavento | 18ccbb3 | 2024-03-24 02:16:03 -0400 | [diff] [blame] | 48 | apt-get install -Uy --no-install-recommends $(cat /deps/ndn-cxx) \ |
Davide Pesavento | 5eb7a07 | 2024-05-03 16:52:23 -0400 | [diff] [blame] | 49 | && apt-get distclean |
Davide Pesavento | 18ccbb3 | 2024-03-24 02:16:03 -0400 | [diff] [blame] | 50 | |
Davide Pesavento | 5eb7a07 | 2024-05-03 16:52:23 -0400 | [diff] [blame] | 51 | RUN --mount=from=build,source=/usr,target=/build \ |
Davide Pesavento | 18ccbb3 | 2024-03-24 02:16:03 -0400 | [diff] [blame] | 52 | cp -av /build/lib/libndn-cxx.so.* /usr/lib/ \ |
| 53 | && cp -av /build/bin/ndnsec* /usr/bin/ |