Add SPDDK build
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
# Build SPDK's nvmf_tgt from source.
|
||||
#
|
||||
# There is no reliable official `spdk/spdk` image to pull (SPDK's guidance is to
|
||||
# build your own — https://spdk.io/doc/containers.html), so we compile a pinned
|
||||
# release here. Single-stage: the image is large and the FIRST build is slow
|
||||
# (~10-20 min — it pulls submodules incl. DPDK and compiles them), but it's
|
||||
# self-contained, reproducible, and cached thereafter. Bump SPDK_VERSION to a
|
||||
# tag from https://github.com/spdk/spdk/releases.
|
||||
FROM ubuntu:24.04
|
||||
|
||||
ARG SPDK_VERSION=v24.09
|
||||
ARG SPDK_REPO=https://github.com/spdk/spdk
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends git ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Shallow-clone the pinned release; submodules at their pinned commits.
|
||||
RUN git clone --branch "${SPDK_VERSION}" --depth 1 "${SPDK_REPO}" /spdk \
|
||||
&& git -C /spdk submodule update --init --recursive
|
||||
|
||||
# SPDK's own dependency installer (kernel headers, build tools, DPDK deps,
|
||||
# python for rpc.py, …). Then configure (TCP nvmf transport is in the default
|
||||
# build; trim the test artifacts) and build.
|
||||
RUN /spdk/scripts/pkgdep.sh \
|
||||
&& cd /spdk \
|
||||
&& ./configure --disable-tests --disable-unit-tests \
|
||||
&& make -j"$(nproc)"
|
||||
|
||||
# nvmf_tgt lives in build/bin; rpc.py in scripts/ (kept ON PATH so its relative
|
||||
# imports resolve from the source tree). spdk-setup.sh locates both via `command
|
||||
# -v`. LD_LIBRARY_PATH is defensive in case of a shared-lib build.
|
||||
ENV PATH=/spdk/build/bin:/spdk/scripts:$PATH \
|
||||
LD_LIBRARY_PATH=/spdk/build/lib:/spdk/dpdk/build/lib
|
||||
|
||||
# spdk-setup.sh is bind-mounted at /spdk-setup.sh and set as the entrypoint by
|
||||
# docker-compose.yml.
|
||||
Reference in New Issue
Block a user