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 | 8466717 | 2024-04-14 14:00:44 -0400 | [diff] [blame] | 24 | ARG JOBS |
Davide Pesavento | 18ccbb3 | 2024-03-24 02:16:03 -0400 | [diff] [blame] | 25 | RUN --mount=type=bind,rw,target=/src <<EOF |
| 26 | set -eux |
| 27 | cd /src |
| 28 | ./waf configure \ |
| 29 | --prefix=/usr \ |
| 30 | --libdir=/usr/lib \ |
| 31 | --sysconfdir=/etc \ |
| 32 | --localstatedir=/var \ |
| 33 | --sharedstatedir=/var \ |
| 34 | --disable-static \ |
| 35 | --enable-shared |
| 36 | ./waf build |
| 37 | ./waf install |
Junxiao Shi | 995c411 | 2023-11-18 19:33:43 +0000 | [diff] [blame] | 38 | |
Davide Pesavento | 18ccbb3 | 2024-03-24 02:16:03 -0400 | [diff] [blame] | 39 | mkdir -p /deps/debian |
| 40 | touch /deps/debian/control |
| 41 | cd /deps |
| 42 | dpkg-shlibdeps --ignore-missing-info /usr/lib/libndn-cxx.so.* /usr/bin/ndnsec -O \ |
| 43 | | sed -n 's|^shlibs:Depends=||p' | sed 's| ([^)]*),\?||g' > ndn-cxx |
| 44 | EOF |
| 45 | |
Davide Pesavento | 4b3aa4f | 2024-04-06 22:00:10 -0400 | [diff] [blame] | 46 | FROM ubuntu:23.10 AS runtime |
| 47 | ARG SOURCE_DATE_EPOCH |
Davide Pesavento | 18ccbb3 | 2024-03-24 02:16:03 -0400 | [diff] [blame] | 48 | |
| 49 | RUN --mount=type=bind,from=build,source=/deps,target=/deps \ |
| 50 | apt-get install -Uy --no-install-recommends $(cat /deps/ndn-cxx) \ |
| 51 | && rm -rf /var/lib/apt/lists/* |
| 52 | |
| 53 | RUN --mount=type=bind,from=build,source=/usr,target=/build \ |
| 54 | cp -av /build/lib/libndn-cxx.so.* /usr/lib/ \ |
| 55 | && cp -av /build/bin/ndnsec* /usr/bin/ |