-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (40 loc) · 1.79 KB
/
Copy pathDockerfile
File metadata and controls
51 lines (40 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# syntax=docker/dockerfile:1
FROM debian:bookworm AS build
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt install -y --no-install-recommends \
build-essential cmake git ca-certificates wget lsb-release gnupg doxygen graphviz \
&& wget -O /tmp/apache-arrow-apt-source.deb \
"https://packages.apache.org/artifactory/arrow/debian/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb" \
&& apt install -y --no-install-recommends /tmp/apache-arrow-apt-source.deb \
&& apt-get update \
&& apt install -y --no-install-recommends \
libosmium2-dev libprotozero-dev libexpat1-dev \
libbz2-dev zlib1g-dev libzstd-dev libcurl4-openssl-dev \
libarrow-dev libarrow-compute-dev libparquet-dev \
libgtest-dev
WORKDIR /src
COPY CMakeLists.txt ./
COPY src ./src
COPY tests ./tests
RUN cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
&& cmake --build build -j"$(nproc)"
RUN ctest --test-dir build --output-on-failure
# Collect the binary together with every shared library it actually links
# against (via ldd), instead of re-declaring versioned Debian package names
# in the runtime stage. Guessing package names such as libarrowNNNN has
# proven fragile across Arrow version bumps; this approach tracks whatever
# the build stage actually produced.
RUN mkdir -p /out/lib \
&& cp build/karmamap /out/karmamap \
&& ldd /out/karmamap \
| awk '$2 == "=>" && $3 ~ /^\// { print $3 }' \
| sort -u \
| xargs -I{} cp -L {} /out/lib/
FROM debian:bookworm-slim AS runtime
RUN apt-get update && apt install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /out/lib/ /usr/local/lib/
COPY --from=build /out/karmamap /usr/local/bin/karmamap
RUN ldconfig
WORKDIR /data