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-log-dev \ |
| 12 | libboost-program-options-dev \ |
Junxiao Shi | 995c411 | 2023-11-18 19:33:43 +0000 | [diff] [blame] | 13 | libboost-stacktrace-dev \ |
Davide Pesavento | e371003 | 2024-02-05 19:57:05 -0500 | [diff] [blame] | 14 | libboost-thread-dev \ |
Davide Pesavento | 18ccbb3 | 2024-03-24 02:16:03 -0400 | [diff] [blame] | 15 | libsqlite3-dev \ |
| 16 | libssl-dev \ |
| 17 | pkgconf \ |
| 18 | python3 \ |
Davide Pesavento | 5eb7a07 | 2024-05-03 16:52:23 -0400 | [diff] [blame] | 19 | && apt-get distclean |
Junxiao Shi | 995c411 | 2023-11-18 19:33:43 +0000 | [diff] [blame] | 20 | |
Davide Pesavento | 8466717 | 2024-04-14 14:00:44 -0400 | [diff] [blame] | 21 | ARG JOBS |
Davide Pesavento | 5eb7a07 | 2024-05-03 16:52:23 -0400 | [diff] [blame] | 22 | ARG SOURCE_DATE_EPOCH |
| 23 | RUN --mount=rw,target=/src <<EOF |
Davide Pesavento | 2be774b | 2024-06-07 17:25:31 -0400 | [diff] [blame] | 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 |
| 36 | mkdir -p /deps/debian |
| 37 | touch /deps/debian/control |
| 38 | cd /deps |
| 39 | dpkg-shlibdeps --ignore-missing-info /usr/lib/libndn-cxx.so.* /usr/bin/ndnsec -O \ |
| 40 | | sed -n 's|^shlibs:Depends=||p' | sed 's| ([^)]*),\?||g' > ndn-cxx |
Davide Pesavento | 18ccbb3 | 2024-03-24 02:16:03 -0400 | [diff] [blame] | 41 | EOF |
| 42 | |
Davide Pesavento | 18ccbb3 | 2024-03-24 02:16:03 -0400 | [diff] [blame] | 43 | |
Davide Pesavento | 5eb7a07 | 2024-05-03 16:52:23 -0400 | [diff] [blame] | 44 | FROM ubuntu:24.04 AS runtime |
| 45 | |
| 46 | RUN --mount=from=build,source=/deps,target=/deps \ |
Davide Pesavento | 2be774b | 2024-06-07 17:25:31 -0400 | [diff] [blame] | 47 | apt-get install -Uy --no-install-recommends \ |
| 48 | $(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/ |