-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (36 loc) · 2.06 KB
/
Copy pathDockerfile
File metadata and controls
37 lines (36 loc) · 2.06 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
# Portable dfkv build with RDMA, pinned to an OLD glibc for wide compatibility.
#
# Why ubuntu:22.04 (glibc 2.35): a dynamically-linked binary's glibc floor = the
# glibc it was BUILT against. Building on a newer host (e.g. ubuntu:24.04 / glibc
# 2.39) makes artifacts that FAIL on older nodes with "GLIBC_2.3x not found".
# 2.35 runs on RHEL9/Ubuntu22.04+ and most current GPU nodes. Build once here, deploy
# on any node with glibc >= 2.35 -- no per-node rebuild.
#
# DFKV_STATIC_LIBSTDCXX folds libstdc++/libgcc into the artifacts (those are NOT
# glibc; static-linking them removes a separate runtime dep). libibverbs CANNOT
# be static (it dlopen()s provider drivers at runtime), so the run node still
# needs rdma-core / libibverbs and their hardware provider plugins installed.
# ubuntu:22.04, pinned so a release tag always rebuilds from identical bytes.
ARG DFKV_BASE_IMAGE=docker.io/library/ubuntu@sha256:3b06811b2afd352be909dd088a004166d665dc76d38b13eada33522a9d915c6f
FROM ${DFKV_BASE_IMAGE} AS build
RUN apt-get update && apt-get install -y --no-install-recommends \
cmake ninja-build g++ git ca-certificates libibverbs-dev liburing-dev && \
rm -rf /var/lib/apt/lists/*
WORKDIR /src
COPY . .
RUN cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DDFKV_BUILD_TESTS=OFF \
-DDFKV_WITH_RDMA=ON -DDFKV_WITH_URING=ON -DDFKV_STATIC_LIBSTDCXX=ON && \
cmake --build build -j && cmake --install build --prefix /out && \
(strip /out/bin/* /out/lib/*.so* 2>/dev/null || true)
# Artifacts (portable, glibc>=2.35): /out/bin/{dfkv_server,dfkv_mds,dfkv_bench,
# dfkv_smoke,dfkvctl} and /out/lib/libdfkv.so. Extract with:
# docker build -t dfkv-build --target build . && \
# id=$(docker create dfkv-build) && docker cp $id:/out ./dist && docker rm $id
FROM ${DFKV_BASE_IMAGE} AS runtime
RUN apt-get update && apt-get install -y --no-install-recommends \
rdma-core libibverbs1 ibverbs-providers && rm -rf /var/lib/apt/lists/*
COPY --from=build /out/ /usr/local/
RUN ldconfig
EXPOSE 12000
ENTRYPOINT ["dfkv_server"]
CMD ["--dir", "/data", "--port", "12000", "--cap", "6442450944"]