[PATCH] doc: using container to build and run applications
Andrea Panattoni
apanatto at redhat.com
Wed Jun 3 16:04:21 CEST 2026
Add explanation about how container runtimes like podman
or docker can be used to build and run DPDK application.
Signed-off-by: Andrea Panattoni <apanatto at redhat.com>
---
.mailmap | 1 +
doc/guides/linux_gsg/build_dpdk.rst | 48 ++++++++++++++++++++++
doc/guides/linux_gsg/build_sample_apps.rst | 32 +++++++++++++++
3 files changed, 81 insertions(+)
diff --git a/.mailmap b/.mailmap
index 89ba6ffccc..48133a4b45 100644
--- a/.mailmap
+++ b/.mailmap
@@ -109,6 +109,7 @@ Andre Muezerie <andremue at linux.microsoft.com> <andremue at microsoft.com>
Andre Richter <andre.o.richter at gmail.com>
Andrea Arcangeli <aarcange at redhat.com>
Andrea Grandi <andrea.grandi at intel.com>
+Andrea Panattoni <apanatto at redhat.com>
Andrew Bailey <abailey at iol.unh.edu>
Andrew Boyer <andrew.boyer at amd.com> <aboyer at pensando.io>
Andrew Harvey <agh at cisco.com>
diff --git a/doc/guides/linux_gsg/build_dpdk.rst b/doc/guides/linux_gsg/build_dpdk.rst
index ed30e4a5f1..cfd10c0310 100644
--- a/doc/guides/linux_gsg/build_dpdk.rst
+++ b/doc/guides/linux_gsg/build_dpdk.rst
@@ -337,3 +337,51 @@ build system is shown below:
dpdk = dependency('libdpdk')
sources = files('main.c')
executable('dpdk-app', sources, dependencies: dpdk)
+
+
+.. _building_dpdk_in_container:
+
+Building Applications in a Container
+------------------------------------
+
+DPDK can be built inside a container to provide a reproducible build environment.
+The following example uses Podman with a Fedora-based Containerfile.
+
+.. note::
+
+ These instructions also work with Docker by replacing ``podman`` with ``docker``.
+
+Create a ``Containerfile`` in the top-level DPDK source directory:
+
+.. code-block:: none
+
+ FROM fedora:latest
+
+ RUN dnf -y upgrade && dnf -y install \
+ libbsd-devel \
+ numactl-devel \
+ meson \
+ ninja-build \
+ python3-pyelftools \
+ && dnf group install -y development-tools \
+ && dnf clean all
+
+ COPY ./ /dpdk
+ WORKDIR /dpdk
+
+ RUN meson setup build -Dexamples=helloworld && ninja -C build install
+
+Build the container image from the DPDK source directory:
+
+.. code-block:: console
+
+ podman build -t dpdk-builder -f Containerfile .
+
+Once the build completes, verify that the helloworld example runs:
+
+.. code-block:: console
+
+ podman run --rm dpdk-builder /dpdk/build/examples/dpdk-helloworld
+
+See :ref:`running_sample_app_in_container` for how to run DPDK applications
+from this container image.
diff --git a/doc/guides/linux_gsg/build_sample_apps.rst b/doc/guides/linux_gsg/build_sample_apps.rst
index 5195af67ad..7154f64723 100644
--- a/doc/guides/linux_gsg/build_sample_apps.rst
+++ b/doc/guides/linux_gsg/build_sample_apps.rst
@@ -125,3 +125,35 @@ Additional sample applications are included in the DPDK examples directory.
These sample applications may be built and run in a manner similar to that described in earlier sections in this manual.
In addition, see the *DPDK Sample Applications User Guide* for a description of the application,
specific instructions on compilation and execution and some explanation of the code.
+
+
+.. _running_sample_app_in_container:
+
+Running Sample Application in a Container
+-----------------------------------------
+
+A DPDK application can be run inside a container using the image built
+in :ref:`building_dpdk_in_container`.
+
+.. warning::
+
+ Hugepages must be configured on the host before running a DPDK application
+ in a container.
+ Refer to :ref:`linux_gsg_hugepages` for setup instructions.
+
+The following example runs testpmd in interactive mode with no physical NICs:
+
+.. code-block:: console
+
+ podman run -it --privileged \
+ -v /dev/hugepages:/dev/hugepages \
+ dpdk-builder \
+ ./build/app/dpdk-testpmd --no-pci -- -i
+
+.. note::
+
+ The ``--privileged`` flag grants access to hugepages and hardware resources.
+ For production deployments, consider using more fine-grained capabilities
+ and device access instead.
+
+ These instructions also work with Docker by replacing ``podman`` with ``docker``.
--
2.54.0
More information about the dev
mailing list