Skip to contentSkip to conversation

build: add dockerfile for building docker image

PATCH Superseded Abdul Halim 5 participants 24 messages Aug 27, 2019 – Jun 12, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build: add dockerfile for building docker image

Adding a Dockerfile with Ubuntu bionic base image to build dpdk as shared library. This docker image could be used as base image to build and run dpdk applications in containers.

---
 extras/Dockerfile.ubuntu | 38 ++++++++++++++++++++++++++++++++++++++
 extras/README.md         |  8 ++++++++
 2 files changed, 46 insertions(+)
 create mode 100644 extras/Dockerfile.ubuntu
 create mode 100644 extras/README.md
extras/Dockerfile.ubuntu new file +38 -0
new file mode 100644
index 0000000..3d5b36b
@@ -0,0 +1,38 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019 Intel Corporation
+FROM ubuntu:bionic
+
+# install requirements for getting and building DPDK
+# including dependencies for DPDK features
+RUN apt-get update && apt-get install -y \
+	build-essential \
+	pkgconf \
+	python3 \
+	python3-pip \
+	ninja-build \
+	libjansson-dev \
+	libbsd-dev \
+	libnuma-dev \
+	libssl-dev \
+	zlib1g-dev \
+	libpcap-dev \
+	libibverbs-dev \
+		&& pip3 install meson
+
+ADD . /tmp/dpdk
+
+WORKDIR /tmp/dpdk
+
+RUN meson build \
+	-Ddefault_library=shared \
+	-Dmachine=default \
+	-Dper_library_versions=false \
+		&& ninja -C build install \
+        && cd /; rm -rf /tmp/dpdk
+
+WORKDIR /
+
+# Installed DPDK Shared library location:
+# lib dir : /usr/local/lib/
+# include : /usr/local/include/
+# pkgconfig file: /usr/local/lib/x86_64-linux-gnu/pkgconfig/libdpdk.pc
extras/README.md new file +8 -0
new file mode 100644
index 0000000..967ddf7
@@ -0,0 +1,8 @@
+# Build DPDK Docker image
+
+To build a docker image run the following command from dpdk root directory.
+
+```
+DOCKER_TAG="dpdk"
+docker build -t ${DOCKER_TAG} -f extras/Dockerfile.ubuntu .
+```
Signature · 13 lines
1.8.3.1

--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263


This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.
#1 lore raw

Hi Abdul,

Comments inline.

extras/Dockerfile.ubuntu

Quoted 13 lines · Abdul Halim

Adding a Dockerfile with Ubuntu bionic base image to build dpdk as shared library. This docker image could be used as base image to build and run dpdk applications in containers.

---
 extras/Dockerfile.ubuntu | 38 ++++++++++++++++++++++++++++++++++++++
 extras/README.md         |  8 ++++++++
 2 files changed, 46 insertions(+)
 create mode 100644 extras/Dockerfile.ubuntu
 create mode 100644 extras/README.md
extras/Dockerfile.ubuntu +0 -0

So I would be concerned about it being called Dockerfile.ubuntu, because at the moment it only covers Bionic, and Xenial is still supported until April 21. The pattern FD.io VPP adopts is calling it Dockerfile.bionic.

Quoted 27 lines

new file mode 100644
index 0000000..3d5b36b

extras/Dockerfile.ubuntu new file +22 -0
@@ -0,0 +1,38 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019 Intel Corporation
+FROM ubuntu:bionic
+
+# install requirements for getting and building DPDK
+# including dependencies for DPDK features
+RUN apt-get update && apt-get install -y \
+	build-essential \
+	pkgconf \
+	python3 \
+	python3-pip \
+	ninja-build \
+	libjansson-dev \
+	libbsd-dev \
+	libnuma-dev \
+	libssl-dev \
+	zlib1g-dev \
+	libpcap-dev \
+	libibverbs-dev \
+		&& pip3 install meson
+
+ADD . /tmp/dpdk

extras/Dockerfile.ubuntu line 32

Quoted 10 lines
extras/Dockerfile.ubuntu new file +10 -0
+
+WORKDIR /tmp/dpdk
+
+RUN meson build \
+	-Ddefault_library=shared \
+	-Dmachine=default \
+	-Dper_library_versions=false \
+		&& ninja -C build install \
+        && cd /; rm -rf /tmp/dpdk
+

Is it safe to remove /tmp/dpdk, then remove the WORKDIR. Should be the other way around?

Quoted 21 lines
extras/Dockerfile.ubuntu new file +6 -0
+WORKDIR /
+
+# Installed DPDK Shared library location:
+# lib dir : /usr/local/lib/
+# include : /usr/local/include/
+# pkgconfig file: /usr/local/lib/x86_64-linux-gnu/pkgconfig/libdpdk.pc
extras/README.md new file +8 -0
new file mode 100644
index 0000000..967ddf7
@@ -0,0 +1,8 @@
+# Build DPDK Docker image
+
+To build a docker image run the following command from dpdk root directory.
+
+```
+DOCKER_TAG="dpdk"
+docker build -t ${DOCKER_TAG} -f extras/Dockerfile.ubuntu .
+```
#2 lore raw

Hi Ray,
Thanks for your feedback.
Please see comments inline.

Quoted 25 lines

-----Original Message-----
From: Ray Kinsella [mailto:[email protected]]
Sent: Monday, September 30, 2019 9:54 AM
To: Halim, Abdul <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH] build: add dockerfile for building docker image

Hi Abdul,

Comments inline.

Quoted 7 lines · Abdul Halim

Adding a Dockerfile with Ubuntu bionic base image to build dpdk as shared library. This docker image could be used as base image to build and run dpdk applications in containers.

---
 extras/Dockerfile.ubuntu | 38

++++++++++++++++++++++++++++++++++++++

Quoted 5 lines
 extras/README.md         |  8 ++++++++
 2 files changed, 46 insertions(+)
 create mode 100644 extras/Dockerfile.ubuntu  create mode 100644

extras/README.md

Quoted 5 lines

extras/Dockerfile.ubuntu

Quoted 1 line
extras/Dockerfile.ubuntu +0 -0

So I would be concerned about it being called Dockerfile.ubuntu, because at the moment it only covers Bionic, and Xenial is still supported until April 21. The pattern FD.io VPP adopts is calling it Dockerfile.bionic.

I will rename this file to Dockerfile.bionic as suggested.

Quoted 32 lines
Quoted 32 lines

new file mode 100644
index 0000000..3d5b36b

extras/Dockerfile.ubuntu new file +26 -0
@@ -0,0 +1,38 @@
+# SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2019 Intel
+Corporation FROM ubuntu:bionic
+
+# install requirements for getting and building DPDK # including
+dependencies for DPDK features RUN apt-get update && apt-get install
+-y \
+	build-essential \
+	pkgconf \
+	python3 \
+	python3-pip \
+	ninja-build \
+	libjansson-dev \
+	libbsd-dev \
+	libnuma-dev \
+	libssl-dev \
+	zlib1g-dev \
+	libpcap-dev \
+	libibverbs-dev \
+		&& pip3 install meson
+
+ADD . /tmp/dpdk
+
+WORKDIR /tmp/dpdk
+
+RUN meson build \
+	-Ddefault_library=shared \
Quoted 9 lines

extras/Dockerfile.ubuntu line 32

Quoted 5 lines
extras/Dockerfile.ubuntu new file +5 -0
+	-Dmachine=default \
+	-Dper_library_versions=false \
+		&& ninja -C build install \
+        && cd /; rm -rf /tmp/dpdk
+

Is it safe to remove /tmp/dpdk, then remove the WORKDIR. Should be the other way around?

The WORKDIR instruction sets the working directory for any RUN, CMD, ENTRYPOINT, COPY and ADD instructions that follow it. It is very much like 'cd' into a location for other commands to run in there. Once the dpdk build is finished successfully and library is installed we no longer need the source files in the final image. So, we can safely remove it and the subsequent ' WORKDIR /' instruction below ensures that WORKDIR is set to a valid location.

Quoted 17 lines

extras/README.md new file mode

Quoted 8 lines
extras/Dockerfile.ubuntu new file +7 -0
+WORKDIR /
+
+# Installed DPDK Shared library location:
+# lib dir : /usr/local/lib/
+# include : /usr/local/include/
+# pkgconfig file:
+/usr/local/lib/x86_64-linux-gnu/pkgconfig/libdpdk.pc
extras/README.md new file mode renamed from extras/README.md +0 -0

100644

extras/README.md line 3

Quoted 7 lines

index 0000000..967ddf7

extras/README.md new file +3 -0
@@ -0,0 +1,8 @@
+# Build DPDK Docker image
+
+To build a docker image run the following command from dpdk root

directory.

Quoted 6 lines

extras/README.md line 8

Quoted 6 lines
extras/README.md new file +5 -0
+
+```
+DOCKER_TAG="dpdk"
+docker build -t ${DOCKER_TAG} -f extras/Dockerfile.ubuntu .
+```

--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

#3 lore raw

PATCH v2 1/1 build: add dockerfile for building docker image

In reply to Abdul Halim

Adding a Dockerfile with Ubuntu bionic base image to build dpdk as shared library. This docker image could be used as base image to build and run dpdk applications in containers.

---

v2:
* renamed Dockerfile name from Dockerfile.ubuntu to Dockerfile.bionic
* added call to ldconfig to update cache of libraries to include newly installed DPDK libs

---
 extras/Dockerfile.bionic | 40 ++++++++++++++++++++++++++++++++++++++++
 extras/README.md         |  8 ++++++++
 2 files changed, 48 insertions(+)
 create mode 100644 extras/Dockerfile.bionic
 create mode 100644 extras/README.md
extras/Dockerfile.bionic new file +40 -0
new file mode 100644
index 0000000..f83b720
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019 Intel Corporation
+FROM ubuntu:bionic
+
+# install requirements for getting and building DPDK
+# including dependencies for DPDK features
+RUN apt-get update && apt-get install -y \
+    build-essential \
+    pkg-config \
+    python3 \
+    python3-pip \
+    ninja-build \
+    libjansson-dev \
+    libbsd-dev \
+    libnuma-dev \
+    libssl-dev \
+    zlib1g-dev \
+    libpcap-dev \
+    libibverbs-dev \
+        && pip3 install meson \
+        && apt-get clean && rm -rf /var/lib/apt/lists/*
+
+ADD . /tmp/dpdk
+
+WORKDIR /tmp/dpdk
+
+RUN meson build \
+    -Ddefault_library=shared \
+    -Dmachine=default \
+    -Dper_library_versions=false \
+        && ninja -C build install \
+        && ldconfig \
+        && cd /; rm -rf /tmp/dpdk
+
+WORKDIR /
+
+# Installed DPDK Shared library location:
+# lib dir : /usr/local/lib/
+# include : /usr/local/include/
+# pkgconfig file: /usr/local/lib/x86_64-linux-gnu/pkgconfig/libdpdk.pc
extras/README.md new file +8 -0
new file mode 100644
index 0000000..f1aa898
@@ -0,0 +1,8 @@
+# Build DPDK Docker image
+
+To build a docker image run the following command from dpdk root directory.
+
+```
+DOCKER_TAG="dpdk"
+docker build -t ${DOCKER_TAG} -f extras/Dockerfile.bionic .
+```
Signature · 13 lines
1.8.3.1

--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263


This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.
Acked-by on v2 1/1
#4 lore raw
Quoted 72 lines · Abdul Halim

Adding a Dockerfile with Ubuntu bionic base image to build dpdk as shared library. This docker image could be used as base image to build and run dpdk applications in containers.

---

v2:
* renamed Dockerfile name from Dockerfile.ubuntu to Dockerfile.bionic
* added call to ldconfig to update cache of libraries to include newly installed DPDK libs

---
 extras/Dockerfile.bionic | 40 ++++++++++++++++++++++++++++++++++++++++
 extras/README.md         |  8 ++++++++
 2 files changed, 48 insertions(+)
 create mode 100644 extras/Dockerfile.bionic
 create mode 100644 extras/README.md
extras/Dockerfile.bionic new file +40 -0
new file mode 100644
index 0000000..f83b720
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019 Intel Corporation
+FROM ubuntu:bionic
+
+# install requirements for getting and building DPDK
+# including dependencies for DPDK features
+RUN apt-get update && apt-get install -y \
+    build-essential \
+    pkg-config \
+    python3 \
+    python3-pip \
+    ninja-build \
+    libjansson-dev \
+    libbsd-dev \
+    libnuma-dev \
+    libssl-dev \
+    zlib1g-dev \
+    libpcap-dev \
+    libibverbs-dev \
+        && pip3 install meson \
+        && apt-get clean && rm -rf /var/lib/apt/lists/*
+
+ADD . /tmp/dpdk
+
+WORKDIR /tmp/dpdk
+
+RUN meson build \
+    -Ddefault_library=shared \
+    -Dmachine=default \
+    -Dper_library_versions=false \
+        && ninja -C build install \
+        && ldconfig \
+        && cd /; rm -rf /tmp/dpdk
+
+WORKDIR /
+
+# Installed DPDK Shared library location:
+# lib dir : /usr/local/lib/
+# include : /usr/local/include/
+# pkgconfig file: /usr/local/lib/x86_64-linux-gnu/pkgconfig/libdpdk.pc
extras/README.md new file +0 -0
new file mode 100644
index 0000000..f1aa898

extras/README.md line 8

Quoted 8 lines
extras/README.md new file +8 -0
@@ -0,0 +1,8 @@
+# Build DPDK Docker image
+
+To build a docker image run the following command from dpdk root directory.
+
+```
+DOCKER_TAG="dpdk"
+docker build -t ${DOCKER_TAG} -f extras/Dockerfile.bionic .
+```
Tested-by
#5 lore raw
Quoted 6 lines · Ray Kinsella
Quoted 3 lines · Abdul Halim

Adding a Dockerfile with Ubuntu bionic base image to build dpdk as shared library. This docker image could be used as base image to build and run dpdk applications in containers.

Hi Abdul,

I have tested your Dockerfile and confirmed that shared lib is generated under /usr/local as described in the Dockerfile.

Just a comment, I wonder if you add an example of usecase in documentation for helping users understanding how to use.

Regards,
Yasufumi

Quoted 70 lines
Quoted 70 lines

---

v2:
* renamed Dockerfile name from Dockerfile.ubuntu to Dockerfile.bionic
* added call to ldconfig to update cache of libraries to include newly installed DPDK libs

---
  extras/Dockerfile.bionic | 40 ++++++++++++++++++++++++++++++++++++++++
  extras/README.md         |  8 ++++++++
  2 files changed, 48 insertions(+)

create mode 100644 extras/Dockerfile.bionic
create mode 100644 extras/README.md

extras/Dockerfile.bionic new file +40 -0
new file mode 100644
index 0000000..f83b720
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019 Intel Corporation
+FROM ubuntu:bionic
+
+# install requirements for getting and building DPDK
+# including dependencies for DPDK features
+RUN apt-get update && apt-get install -y \
+    build-essential \
+    pkg-config \
+    python3 \
+    python3-pip \
+    ninja-build \
+    libjansson-dev \
+    libbsd-dev \
+    libnuma-dev \
+    libssl-dev \
+    zlib1g-dev \
+    libpcap-dev \
+    libibverbs-dev \
+        && pip3 install meson \
+        && apt-get clean && rm -rf /var/lib/apt/lists/*
+
+ADD . /tmp/dpdk
+
+WORKDIR /tmp/dpdk
+
+RUN meson build \
+    -Ddefault_library=shared \
+    -Dmachine=default \
+    -Dper_library_versions=false \
+        && ninja -C build install \
+        && ldconfig \
+        && cd /; rm -rf /tmp/dpdk
+
+WORKDIR /
+
+# Installed DPDK Shared library location:
+# lib dir : /usr/local/lib/
+# include : /usr/local/include/
+# pkgconfig file: /usr/local/lib/x86_64-linux-gnu/pkgconfig/libdpdk.pc
extras/README.md new file +2 -0
new file mode 100644
index 0000000..f1aa898
@@ -0,0 +1,8 @@
+# Build DPDK Docker image
+
Quoted 9 lines

extras/README.md line 8

Quoted 7 lines
extras/README.md new file +6 -0
+To build a docker image run the following command from dpdk root directory.
+
+```
+DOCKER_TAG="dpdk"
+docker build -t ${DOCKER_TAG} -f extras/Dockerfile.bionic .
+```
#6 lore raw

PATCH v3 1/1 build: add dockerfile for building docker image

In reply to Abdul Halim

Adding a Dockerfile with Ubuntu bionic base image to build dpdk as shared library. This docker image could be used as base image to build and run dpdk applications in containers.

---

v2:
* renamed Dockerfile name from Dockerfile.ubuntu to Dockerfile.bionic
* added call to ldconfig to update cache of libraries to include newly installed DPDK libs

---

v3:
* added example use-case of dpdk dockerfile in extras/README.md

---
 extras/Dockerfile.bionic | 40 +++++++++++++++++++++++++++++++++++++
 extras/README.md         | 52 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 92 insertions(+)
 create mode 100644 extras/Dockerfile.bionic
 create mode 100644 extras/README.md
extras/Dockerfile.bionic new file +40 -0
new file mode 100644
index 0000000..f83b720
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019 Intel Corporation
+FROM ubuntu:bionic
+
+# install requirements for getting and building DPDK
+# including dependencies for DPDK features
+RUN apt-get update && apt-get install -y \
+    build-essential \
+    pkg-config \
+    python3 \
+    python3-pip \
+    ninja-build \
+    libjansson-dev \
+    libbsd-dev \
+    libnuma-dev \
+    libssl-dev \
+    zlib1g-dev \
+    libpcap-dev \
+    libibverbs-dev \
+        && pip3 install meson \
+        && apt-get clean && rm -rf /var/lib/apt/lists/*
+
+ADD . /tmp/dpdk
+
+WORKDIR /tmp/dpdk
+
+RUN meson build \
+    -Ddefault_library=shared \
+    -Dmachine=default \
+    -Dper_library_versions=false \
+        && ninja -C build install \
+        && ldconfig \
+        && cd /; rm -rf /tmp/dpdk
+
+WORKDIR /
+
+# Installed DPDK Shared library location:
+# lib dir : /usr/local/lib/
+# include : /usr/local/include/
+# pkgconfig file: /usr/local/lib/x86_64-linux-gnu/pkgconfig/libdpdk.pc
extras/README.md new file +52 -0

52 lines not on this page · raw message

Signature · 13 lines
1.8.3.1

--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263


This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.
#7 lore raw
Quoted 114 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Abdul Halim
Sent: Tuesday, December 3, 2019 19:42
To: [email protected]
Cc: [email protected]; [email protected]; Abdul Halim <[email protected]>
Subject: [dpdk-dev] [PATCH v3] build: add dockerfile for building docker image

Adding a Dockerfile with Ubuntu bionic base image to build dpdk as shared library. This docker image could be used as base image to build and run dpdk applications in containers.

---

v2:
* renamed Dockerfile name from Dockerfile.ubuntu to Dockerfile.bionic
* added call to ldconfig to update cache of libraries to include newly installed DPDK libs

---

v3:
* added example use-case of dpdk dockerfile in extras/README.md

---
 extras/Dockerfile.bionic | 40
+++++++++++++++++++++++++++++++++++++
 extras/README.md         | 52
++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 92 insertions(+)
 create mode 100644 extras/Dockerfile.bionic  create mode 100644

extras/README.md

extras/Dockerfile.bionic new file mode renamed from extras/Dockerfile.bionic +0 -0

100644 index 0000000..f83b720

extras/Dockerfile.bionic new file +39 -0
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2019 Intel
+Corporation FROM ubuntu:bionic
+
+# install requirements for getting and building DPDK # including
+dependencies for DPDK features RUN apt-get update && apt-get install -y
+\
+    build-essential \
+    pkg-config \
+    python3 \
+    python3-pip \
+    ninja-build \
+    libjansson-dev \
+    libbsd-dev \
+    libnuma-dev \
+    libssl-dev \
+    zlib1g-dev \
+    libpcap-dev \
+    libibverbs-dev \
+        && pip3 install meson \
+        && apt-get clean && rm -rf /var/lib/apt/lists/*
+
+ADD . /tmp/dpdk
+
+WORKDIR /tmp/dpdk
+
+RUN meson build \
+    -Ddefault_library=shared \
+    -Dmachine=default \
+    -Dper_library_versions=false \
+        && ninja -C build install \
+        && ldconfig \
+        && cd /; rm -rf /tmp/dpdk
+
+WORKDIR /
+
+# Installed DPDK Shared library location:
+# lib dir : /usr/local/lib/
+# include : /usr/local/include/
+# pkgconfig file: /usr/local/lib/x86_64-linux-gnu/pkgconfig/libdpdk.pc
extras/README.md new file +3 -0
index 0000000..f38d7f1
@@ -0,0 +1,52 @@
+# Build DPDK Docker image
+
+To build a docker image run the following command from dpdk root

directory.

extras/README.md new file +17 -0
+
+```
+DOCKER_TAG="dpdk"
+docker build -t ${DOCKER_TAG} -f extras/Dockerfile.bionic .
+```
+
+# Example of how to use this dpdk library image
+
+The following steps shows how to use the dpdk shared library container
+to build and run a dpdk application without having to build dpdk
+library for each application.
+
+## Create a dpdk sample app docker file with 'dpdk' as the base image
+
+Create a docker file to build the dpdk helloworld application. Since,
+we are creating a docker file for dpdk helloworld app we need to add
+the dpdk source files, thus create the following docker file in dpdk root

directory.

extras/README.md new file +7 -0
+
+```
+cat << EOF > Dockerfile.dpdkSampleApp
+FROM dpdk
+
+ADD . /opt/dpdk
+

extras/README.md line 38

Quoted 10 lines
extras/README.md new file +10 -0
+WORKDIR /opt/dpdk/examples/helloworld
+RUN make && cp build/helloworld-shared /usr/local/bin/helloworld EOF
+```
+
+## Build sample app docker image
+
+```
+DOCKERAPP_TAG="dpdk-helloworld"
+docker build -t ${DOCKERAPP_TAG} -f Dockerfile.dpdkSampleApp .
+```

Hi Abdul,

I tried the steps on AArch64 platform, and hit error as below:

$ sudo docker build -t ${DOCKERAPP_TAG} -f Dockerfile.dpdkSampleApp .
Sending build context to Docker daemon   2.55GB
Step 1/4 : FROM dpdk
 ---> 955448007987
Step 2/4 : ADD . /opt/dpdk
 ---> d8b58019a7e2
Step 3/4 : WORKDIR /opt/dpdk/examples/helloworld
 ---> Running in 14fc89f7d3cd
Removing intermediate container 14fc89f7d3cd
 ---> 065a682c58fd
Step 4/4 : RUN make && cp build/helloworld-shared /usr/local/bin/helloworld
 ---> Running in 11e755a7180b
Makefile:44: *** "Please define RTE_SDK environment variable".  Stop.
The command '/bin/sh -c make && cp build/helloworld-shared /usr/local/bin/helloworld' returned a non-zero code: 2

Missing define of RTE_SDK and RTE_TARGET?

Quoted 28 lines
extras/README.md new file +2 -0
+
+This sample app now can be run like any other applicaiton in a docker

container.

extras/README.md new file +12 -1
+
+```
+$ docker run --rm -it  -v /dev/hugepages:/dev/hugepages dpdk-helloworld
+```
+
+## Running the sample app
+Once inside the container run helloword binary
+
+```
+$ root@11233ed2e69c # helloworld
+```
+
--

1.8.3.1

--------------------------------------------------------------
Intel Research and Development Ireland Limited Registered in Ireland Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

#8 lore raw
Quoted 16 lines · Ruifeng Wang (Arm Technology China)
Quoted 16 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Abdul Halim
Sent: Tuesday, December 3, 2019 19:42
To: [email protected]
Cc: [email protected]; [email protected]; Abdul Halim <[email protected]>
Subject: [dpdk-dev] [PATCH v3] build: add dockerfile for building docker image

Adding a Dockerfile with Ubuntu bionic base image to build dpdk as shared library. This docker image could be used as base image to build and run dpdk applications in containers.

[...]

Quoted 64 lines
Quoted 34 lines
extras/README.md new file +3 -0
index 0000000..f38d7f1
@@ -0,0 +1,52 @@
+# Build DPDK Docker image
+
+To build a docker image run the following command from dpdk root

directory.

extras/README.md new file +17 -0
+
+```
+DOCKER_TAG="dpdk"
+docker build -t ${DOCKER_TAG} -f extras/Dockerfile.bionic .
+```
+
+# Example of how to use this dpdk library image
+
+The following steps shows how to use the dpdk shared library container
+to build and run a dpdk application without having to build dpdk
+library for each application.
+
+## Create a dpdk sample app docker file with 'dpdk' as the base image
+
+Create a docker file to build the dpdk helloworld application. Since,
+we are creating a docker file for dpdk helloworld app we need to add
+the dpdk source files, thus create the following docker file in dpdk root

directory.

extras/README.md new file +7 -0
+
+```
+cat << EOF > Dockerfile.dpdkSampleApp
+FROM dpdk
+
+ADD . /opt/dpdk
+

extras/README.md line 38

Quoted 10 lines
extras/README.md new file +10 -0
+WORKDIR /opt/dpdk/examples/helloworld
+RUN make && cp build/helloworld-shared /usr/local/bin/helloworld EOF
+```
+
+## Build sample app docker image
+
+```
+DOCKERAPP_TAG="dpdk-helloworld"
+docker build -t ${DOCKERAPP_TAG} -f Dockerfile.dpdkSampleApp .
+```

Hi Abdul,

I tried the steps on AArch64 platform, and hit error as below:

$ sudo docker build -t ${DOCKERAPP_TAG} -f Dockerfile.dpdkSampleApp .
Sending build context to Docker daemon   2.55GB
Step 1/4 : FROM dpdk
  ---> 955448007987
Step 2/4 : ADD . /opt/dpdk
  ---> d8b58019a7e2
Step 3/4 : WORKDIR /opt/dpdk/examples/helloworld
  ---> Running in 14fc89f7d3cd
Removing intermediate container 14fc89f7d3cd
  ---> 065a682c58fd
Step 4/4 : RUN make && cp build/helloworld-shared /usr/local/bin/helloworld
  ---> Running in 11e755a7180b
Makefile:44: *** "Please define RTE_SDK environment variable".  Stop.
The command '/bin/sh -c make && cp build/helloworld-shared /usr/local/bin/helloworld' returned a non-zero code: 2
Quoted 1 line

Missing define of RTE_SDK and RTE_TARGET?

Hi Ruifeng,

I think you run you run the command in dpdk/extras. However, this 'Dockerfile.dpdkSampleApp' is expected to be run in dpdk's root dir so that it is mounted as '/opt/dpdk' in the second step above. I have tested this Dockerfile on Ubuntu 18.04 and compiled without any error. RTE_SDK is set correctly, but dpdk's directory is not mounted in the container.

Abdul,

Quoted 1 line
Quoted 1 line

+docker build -t ${DOCKERAPP_TAG} -f Dockerfile.dpdkSampleApp .

I think this line should be corrected as following, and make it clear it should be run in dpdk's root.

  docker build -t ${DOCKERAPP_TAG} -f extras/Dockerfile.dpdkSampleApp .

Even if the container image is built successfully, there is another problem in running app because it isn't run in privileged mode.

root@0d2a309dfd2c:/opt/dpdk/examples/helloworld# helloworld
EAL: Detected 16 lcore(s)
EAL: Detected 1 NUMA nodes
...
EAL: Failed to get current mempolicy: Operation not permitted. Assuming MPOL_DEFAULT.
set_mempolicy: Operation not permitted
set_mempolicy: Operation not permitted
EAL: error allocating rte services array
EAL: FATAL: rte_service_init() failed
EAL: rte_service_init() failed
PANIC in main():
Cannot init EAL
5: [helloworld(+0x84a) [0x55555555484a]]
4: [/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7ffff7721b97]]
3: [helloworld(+0x818) [0x555555554818]]
2: [/usr/local/lib/x86_64-linux-gnu/librte_eal.so.20.1(__rte_panic+0xbd) [0x7ffff7afb410]]
1: [/usr/local/lib/x86_64-linux-gnu/librte_eal.so.20.1(rte_dump_stack+0x2e) [0x7ffff7b1598e]]
Aborted (core dumped)

I think '--privileged' option should be added to avoid the error.

$ docker run --rm --privileged -it  -v /dev/hugepages:/dev/hugepages dpdk-helloworld

I have one more suggestion. You might have added $USER to docker group and run docker without sudo like as following.

$ sudo groupadd docker
$ sudo usermod -aG docker $USER

I wounder it is better to use sudo in your examples, or add the instruction for users not familiar with docker.

Regards,
Yasufumi

Quoted 30 lines
Quoted 29 lines
extras/README.md new file +2 -0
+
+This sample app now can be run like any other applicaiton in a docker

container.

extras/README.md new file +12 -1
+
+```
+$ docker run --rm -it  -v /dev/hugepages:/dev/hugepages dpdk-helloworld
+```
+
+## Running the sample app
+Once inside the container run helloword binary
+
+```
+$ root@11233ed2e69c # helloworld
+```
+
--

1.8.3.1

--------------------------------------------------------------
Intel Research and Development Ireland Limited Registered in Ireland Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

#9 lore raw
Quoted 151 lines

-----Original Message-----
From: Yasufumi Ogawa <[email protected]>
Sent: Thursday, December 5, 2019 7:52 PM
To: Ruifeng Wang (Arm Technology China) <[email protected]>; Halim, Abdul <[email protected]>; [email protected]
Cc: Kinsella, Ray <[email protected]>; nd <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v3] build: add dockerfile for building docker image

Quoted 16 lines · Ruifeng Wang (Arm Technology China)
Quoted 16 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Abdul Halim
Sent: Tuesday, December 3, 2019 19:42
To: [email protected]
Cc: [email protected]; [email protected]; Abdul Halim <[email protected]>
Subject: [dpdk-dev] [PATCH v3] build: add dockerfile for building docker image

Adding a Dockerfile with Ubuntu bionic base image to build dpdk as shared library. This docker image could be used as base image to build and run dpdk applications in containers.

[...]

Quoted 1 line

extras/README.md new file mode

Quoted 1 line
extras/README.md new file mode renamed from extras/README.md +0 -0

100644

Quoted 48 lines
Quoted 33 lines

index 0000000..f38d7f1

extras/README.md new file +3 -0
@@ -0,0 +1,52 @@
+# Build DPDK Docker image
+
+To build a docker image run the following command from dpdk root

directory.

extras/README.md new file +19 -0
+
+```
+DOCKER_TAG="dpdk"
+docker build -t ${DOCKER_TAG} -f extras/Dockerfile.bionic .
+```
+
+# Example of how to use this dpdk library image
+
+The following steps shows how to use the dpdk shared library
+container to build and run a dpdk application without having to
+build dpdk library for each application.
+
+## Create a dpdk sample app docker file with 'dpdk' as the base
+image
+
+Create a docker file to build the dpdk helloworld application.
+Since, we are creating a docker file for dpdk helloworld app we need
+to add the dpdk source files, thus create the following docker file
+in dpdk root

directory.

extras/README.md new file +5 -0
+
+```
+cat << EOF > Dockerfile.dpdkSampleApp FROM dpdk
+
+ADD . /opt/dpdk

extras/README.md line 38

Quoted 10 lines
extras/README.md new file +10 -0
+
+WORKDIR /opt/dpdk/examples/helloworld RUN make && cp
+build/helloworld-shared /usr/local/bin/helloworld EOF ```
+
+## Build sample app docker image
+
+```
+DOCKERAPP_TAG="dpdk-helloworld"
+docker build -t ${DOCKERAPP_TAG} -f Dockerfile.dpdkSampleApp .
+```

Hi Abdul,

I tried the steps on AArch64 platform, and hit error as below:

Quoted 11 lines
$ sudo docker build -t ${DOCKERAPP_TAG} -f Dockerfile.dpdkSampleApp .
Sending build context to Docker daemon   2.55GB
Step 1/4 : FROM dpdk
  ---> 955448007987
Step 2/4 : ADD . /opt/dpdk
  ---> d8b58019a7e2
Step 3/4 : WORKDIR /opt/dpdk/examples/helloworld
  ---> Running in 14fc89f7d3cd
Removing intermediate container 14fc89f7d3cd
  ---> 065a682c58fd
Step 4/4 : RUN make && cp build/helloworld-shared

/usr/local/bin/helloworld

Quoted 6 lines

---> Running in 11e755a7180b
Makefile:44: *** "Please define RTE_SDK environment variable". Stop. The command '/bin/sh -c make && cp build/helloworld-shared /usr/local/bin/helloworld' returned a non-zero code: 2

Missing define of RTE_SDK and RTE_TARGET?

Hi Ruifeng,

I think you run you run the command in dpdk/extras. However, this 'Dockerfile.dpdkSampleApp' is expected to be run in dpdk's root dir so that it is mounted as '/opt/dpdk' in the second step above. I have tested this Dockerfile on Ubuntu 18.04 and compiled without any error. RTE_SDK is set correctly, but dpdk's directory is not mounted in the container.

Abdul,

Quoted 1 line
Quoted 1 line

+docker build -t ${DOCKERAPP_TAG} -f Dockerfile.dpdkSampleApp .

I think this line should be corrected as following, and make it clear it should be run in dpdk's root.

   docker build -t ${DOCKERAPP_TAG} -f extras/Dockerfile.dpdkSampleApp .

Even if the container image is built successfully, there is another problem in running app because it isn't run in privileged mode.

root@0d2a309dfd2c:/opt/dpdk/examples/helloworld# helloworld
EAL: Detected 16 lcore(s)
EAL: Detected 1 NUMA nodes
...
EAL: Failed to get current mempolicy: Operation not permitted. Assuming
MPOL_DEFAULT.
set_mempolicy: Operation not permitted
set_mempolicy: Operation not permitted
EAL: error allocating rte services array
EAL: FATAL: rte_service_init() failed
EAL: rte_service_init() failed
PANIC in main():
Cannot init EAL
5: [helloworld(+0x84a) [0x55555555484a]]
4: [/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)
[0x7ffff7721b97]]
3: [helloworld(+0x818) [0x555555554818]]
2: [/usr/local/lib/x86_64-linux-gnu/librte_eal.so.20.1(__rte_panic+0xbd)
[0x7ffff7afb410]]
1:
[/usr/local/lib/x86_64-linux-gnu/librte_eal.so.20.1(rte_dump_stack+0x2e)
[0x7ffff7b1598e]]
Aborted (core dumped)

I think '--privileged' option should be added to avoid the error.

$ docker run --rm --privileged -it  -v /dev/hugepages:/dev/hugepages dpdk-
helloworld

I have one more suggestion. You might have added $USER to docker group and run docker without sudo like as following.

Quoted 8 lines
$ sudo groupadd docker
$ sudo usermod -aG docker $USER

I wounder it is better to use sudo in your examples, or add the instruction for users not familiar with docker.

Regards,
Yasufumi

Hi Yasufumi,
Thank you for your feedback.
The steps for creating the sample app docker file explains that that we are creating the file at dpdk root directory. So the assumption here is the docker run command also run from there. Not sure if we need to repeat this later also.

The 'cat' command above creates the docker file in dpdk
root directory for simplicity. Actually, we just needed the examples/helloworld source code from there. As for other user application, the docker file could be anywhere, not necessarily in dpdk tree at all. User need to run docker build from where their own docker file is.

The dpdk 'base' container should be used as shared-lib to build dpdk application with libdpdk. So, the dpdk source code, RTE_SDK or RTE_TARGET is not needed unless the pkg-config is unable to find libdpdk.

I will update the patch with suggested '--privileged' flag on docker run command. Not sure if we should cover the docker permissions and docker specific configurations on this doc though. I am sure user can find those resources somewhere else if needed.

Hi Ruifeng,
Unfortunately I could not create Aarch64 environment to test this. Could you please run the following command in your env and see if you can get output as below:

$ docker run --rm dpdk pkg-config --list-all | grep libdpdk
libdpdk          DPDK - The Data Plane Development Kit (DPDK).

Regards,
Abdul

Quoted 27 lines
Quoted 27 lines
Quoted 27 lines
extras/README.md new file +3 -0
+
+This sample app now can be run like any other applicaiton in a
+docker

container.

extras/README.md new file +12 -1
+
+```
+$ docker run --rm -it  -v /dev/hugepages:/dev/hugepages
+dpdk-helloworld ```
+
+## Running the sample app
+Once inside the container run helloword binary
+
+```
+$ root@11233ed2e69c # helloworld
+```
+
--

1.8.3.1

--------------------------------------------------------------
Intel Research and Development Ireland Limited Registered in Ireland Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

#10 lore raw
Quoted 12 lines

-----Original Message-----
From: Halim, Abdul <[email protected]>
Sent: Friday, December 6, 2019 19:13
To: Yasufumi Ogawa <[email protected]>; Ruifeng Wang (Arm Technology China) <[email protected]>; [email protected]
Cc: Kinsella, Ray <[email protected]>; nd <[email protected]>; Richardson, Bruce <[email protected]>
Subject: RE: [dpdk-dev] [PATCH v3] build: add dockerfile for building docker image

Quoted 106 lines
Quoted 4 lines

-----Original Message-----
From: Yasufumi Ogawa <[email protected]>
Sent: Thursday, December 5, 2019 7:52 PM
To: Ruifeng Wang (Arm Technology China) <[email protected]>;

Halim,

Quoted 101 lines

Abdul <[email protected]>; [email protected]
Cc: Kinsella, Ray <[email protected]>; nd <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v3] build: add dockerfile for building docker image

Quoted 16 lines · Ruifeng Wang (Arm Technology China)
Quoted 16 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Abdul Halim
Sent: Tuesday, December 3, 2019 19:42
To: [email protected]
Cc: [email protected]; [email protected]; Abdul Halim <[email protected]>
Subject: [dpdk-dev] [PATCH v3] build: add dockerfile for building docker image

Adding a Dockerfile with Ubuntu bionic base image to build dpdk as shared library. This docker image could be used as base image to build and run dpdk applications in containers.

[...]

Quoted 1 line

extras/README.md new file mode

Quoted 1 line
extras/README.md new file mode renamed from extras/README.md +0 -0

100644

Quoted 48 lines
Quoted 33 lines

index 0000000..f38d7f1

extras/README.md new file +3 -0
@@ -0,0 +1,52 @@
+# Build DPDK Docker image
+
+To build a docker image run the following command from dpdk root

directory.

extras/README.md new file +19 -0
+
+```
+DOCKER_TAG="dpdk"
+docker build -t ${DOCKER_TAG} -f extras/Dockerfile.bionic .
+```
+
+# Example of how to use this dpdk library image
+
+The following steps shows how to use the dpdk shared library
+container to build and run a dpdk application without having to
+build dpdk library for each application.
+
+## Create a dpdk sample app docker file with 'dpdk' as the base
+image
+
+Create a docker file to build the dpdk helloworld application.
+Since, we are creating a docker file for dpdk helloworld app we
+need to add the dpdk source files, thus create the following
+docker file in dpdk root

directory.

extras/README.md new file +5 -0
+
+```
+cat << EOF > Dockerfile.dpdkSampleApp FROM dpdk
+
+ADD . /opt/dpdk

extras/README.md line 38

Quoted 10 lines
extras/README.md new file +10 -0
+
+WORKDIR /opt/dpdk/examples/helloworld RUN make && cp
+build/helloworld-shared /usr/local/bin/helloworld EOF ```
+
+## Build sample app docker image
+
+```
+DOCKERAPP_TAG="dpdk-helloworld"
+docker build -t ${DOCKERAPP_TAG} -f Dockerfile.dpdkSampleApp .
+```

Hi Abdul,

I tried the steps on AArch64 platform, and hit error as below:

Quoted 11 lines
$ sudo docker build -t ${DOCKERAPP_TAG} -f Dockerfile.dpdkSampleApp .
Sending build context to Docker daemon   2.55GB
Step 1/4 : FROM dpdk
  ---> 955448007987
Step 2/4 : ADD . /opt/dpdk
  ---> d8b58019a7e2
Step 3/4 : WORKDIR /opt/dpdk/examples/helloworld
  ---> Running in 14fc89f7d3cd
Removing intermediate container 14fc89f7d3cd
  ---> 065a682c58fd
Step 4/4 : RUN make && cp build/helloworld-shared

/usr/local/bin/helloworld

Quoted 6 lines

---> Running in 11e755a7180b
Makefile:44: *** "Please define RTE_SDK environment variable". Stop. The command '/bin/sh -c make && cp build/helloworld-shared /usr/local/bin/helloworld' returned a non-zero code: 2

Missing define of RTE_SDK and RTE_TARGET?

Hi Ruifeng,

I think you run you run the command in dpdk/extras. However, this 'Dockerfile.dpdkSampleApp' is expected to be run in dpdk's root dir so that it is mounted as '/opt/dpdk' in the second step above. I have tested this Dockerfile on Ubuntu 18.04 and compiled without any error. RTE_SDK is set correctly, but dpdk's directory is not mounted in the container.

Hi Yasufumi,

I ran the command in dpdk root dir which should be correct.
The issue was due to shared library image not been correctly built. See below.

Thanks.
/Ruifeng

Quoted 78 lines
Quoted 46 lines

Abdul,

Quoted 1 line
Quoted 1 line

+docker build -t ${DOCKERAPP_TAG} -f Dockerfile.dpdkSampleApp .

I think this line should be corrected as following, and make it clear it should be run in dpdk's root.

   docker build -t ${DOCKERAPP_TAG} -f extras/Dockerfile.dpdkSampleApp .

Even if the container image is built successfully, there is another problem in running app because it isn't run in privileged mode.

root@0d2a309dfd2c:/opt/dpdk/examples/helloworld# helloworld
EAL: Detected 16 lcore(s)
EAL: Detected 1 NUMA nodes
...
EAL: Failed to get current mempolicy: Operation not permitted.
Assuming MPOL_DEFAULT.
set_mempolicy: Operation not permitted
set_mempolicy: Operation not permitted
EAL: error allocating rte services array
EAL: FATAL: rte_service_init() failed
EAL: rte_service_init() failed
PANIC in main():
Cannot init EAL
5: [helloworld(+0x84a) [0x55555555484a]]
4: [/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)
[0x7ffff7721b97]]
3: [helloworld(+0x818) [0x555555554818]]
2:
[/usr/local/lib/x86_64-linux-gnu/librte_eal.so.20.1(__rte_panic+0xbd)
[0x7ffff7afb410]]
1:
[/usr/local/lib/x86_64-linux-gnu/librte_eal.so.20.1(rte_dump_stack+0x2
e)
[0x7ffff7b1598e]]
Aborted (core dumped)

I think '--privileged' option should be added to avoid the error.

$ docker run --rm --privileged -it  -v /dev/hugepages:/dev/hugepages
dpdk- helloworld

I have one more suggestion. You might have added $USER to docker group and run docker without sudo like as following.

Quoted 8 lines
$ sudo groupadd docker
$ sudo usermod -aG docker $USER

I wounder it is better to use sudo in your examples, or add the instruction for users not familiar with docker.

Regards,
Yasufumi

Hi Yasufumi,
Thank you for your feedback.
The steps for creating the sample app docker file explains that that we are creating the file at dpdk root directory. So the assumption here is the docker run command also run from there. Not sure if we need to repeat this later also.

The 'cat' command above creates the docker file in dpdk root directory for simplicity. Actually, we just needed the examples/helloworld source code from there. As for other user application, the docker file could be anywhere, not necessarily in dpdk tree at all. User need to run docker build from where their own docker file is.

The dpdk 'base' container should be used as shared-lib to build dpdk application with libdpdk. So, the dpdk source code, RTE_SDK or RTE_TARGET is not needed unless the pkg-config is unable to find libdpdk.

I will update the patch with suggested '--privileged' flag on docker run command.
Not sure if we should cover the docker permissions and docker specific configurations on this doc though. I am sure user can find those resources somewhere else if needed.

Quoted 8 lines

Hi Ruifeng,
Unfortunately I could not create Aarch64 environment to test this. Could you please run the following command in your env and see if you can get output as below:

$ docker run --rm dpdk pkg-config --list-all | grep libdpdk
libdpdk          DPDK - The Data Plane Development Kit (DPDK).

Hi Abdul,

Yes, the issue was due to pkg-config could not find libdpdk. I didn't get expected libdpdk info in pkg-config output.

Just found that even my building of dpdk shared library image was failed. Shared library image build failure was due to local 'build' directory in my dpdk source tree. And the 'build' impacted meson configuration in container.

Not sure if it is a worth to mention that base dpdk tree should be clean.

With '--privileged' flag suggested by Yasufumi:

Thanks.
/Ruifeng

Quoted 46 lines

Regards,
Abdul

Quoted 27 lines
Quoted 27 lines
Quoted 27 lines
extras/README.md new file +3 -0
+
+This sample app now can be run like any other applicaiton in a
+docker

container.

extras/README.md new file +12 -1
+
+```
+$ docker run --rm -it  -v /dev/hugepages:/dev/hugepages
+dpdk-helloworld ```
+
+## Running the sample app
+Once inside the container run helloword binary
+
+```
+$ root@11233ed2e69c # helloworld
+```
+
--

1.8.3.1

--------------------------------------------------------------
Intel Research and Development Ireland Limited Registered in Ireland Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

--------------------------------------------------------------
Intel Research and Development Ireland Limited Registered in Ireland Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

#11 lore raw
Quoted 118 lines · Ruifeng Wang (Arm Technology China)
Quoted 12 lines

-----Original Message-----
From: Halim, Abdul <[email protected]>
Sent: Friday, December 6, 2019 19:13
To: Yasufumi Ogawa <[email protected]>; Ruifeng Wang (Arm Technology China) <[email protected]>; [email protected]
Cc: Kinsella, Ray <[email protected]>; nd <[email protected]>; Richardson, Bruce <[email protected]>
Subject: RE: [dpdk-dev] [PATCH v3] build: add dockerfile for building docker image

Quoted 106 lines
Quoted 4 lines

-----Original Message-----
From: Yasufumi Ogawa <[email protected]>
Sent: Thursday, December 5, 2019 7:52 PM
To: Ruifeng Wang (Arm Technology China) <[email protected]>;

Halim,

Quoted 101 lines

Abdul <[email protected]>; [email protected]
Cc: Kinsella, Ray <[email protected]>; nd <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v3] build: add dockerfile for building docker image

Quoted 16 lines · Ruifeng Wang (Arm Technology China)
Quoted 16 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Abdul Halim
Sent: Tuesday, December 3, 2019 19:42
To: [email protected]
Cc: [email protected]; [email protected]; Abdul Halim <[email protected]>
Subject: [dpdk-dev] [PATCH v3] build: add dockerfile for building docker image

Adding a Dockerfile with Ubuntu bionic base image to build dpdk as shared library. This docker image could be used as base image to build and run dpdk applications in containers.

[...]

Quoted 1 line

extras/README.md new file mode

Quoted 1 line
extras/README.md new file mode renamed from extras/README.md +0 -0

100644

Quoted 48 lines
Quoted 33 lines

index 0000000..f38d7f1

extras/README.md new file +3 -0
@@ -0,0 +1,52 @@
+# Build DPDK Docker image
+
+To build a docker image run the following command from dpdk root

directory.

extras/README.md new file +19 -0
+
+```
+DOCKER_TAG="dpdk"
+docker build -t ${DOCKER_TAG} -f extras/Dockerfile.bionic .
+```
+
+# Example of how to use this dpdk library image
+
+The following steps shows how to use the dpdk shared library
+container to build and run a dpdk application without having to
+build dpdk library for each application.
+
+## Create a dpdk sample app docker file with 'dpdk' as the base
+image
+
+Create a docker file to build the dpdk helloworld application.
+Since, we are creating a docker file for dpdk helloworld app we
+need to add the dpdk source files, thus create the following
+docker file in dpdk root

directory.

extras/README.md new file +5 -0
+
+```
+cat << EOF > Dockerfile.dpdkSampleApp FROM dpdk
+
+ADD . /opt/dpdk

extras/README.md line 38

Quoted 10 lines
extras/README.md new file +10 -0
+
+WORKDIR /opt/dpdk/examples/helloworld RUN make && cp
+build/helloworld-shared /usr/local/bin/helloworld EOF ```
+
+## Build sample app docker image
+
+```
+DOCKERAPP_TAG="dpdk-helloworld"
+docker build -t ${DOCKERAPP_TAG} -f Dockerfile.dpdkSampleApp .
+```

Hi Abdul,

I tried the steps on AArch64 platform, and hit error as below:

Quoted 11 lines
$ sudo docker build -t ${DOCKERAPP_TAG} -f Dockerfile.dpdkSampleApp .
Sending build context to Docker daemon   2.55GB
Step 1/4 : FROM dpdk
   ---> 955448007987
Step 2/4 : ADD . /opt/dpdk
   ---> d8b58019a7e2
Step 3/4 : WORKDIR /opt/dpdk/examples/helloworld
   ---> Running in 14fc89f7d3cd
Removing intermediate container 14fc89f7d3cd
   ---> 065a682c58fd
Step 4/4 : RUN make && cp build/helloworld-shared

/usr/local/bin/helloworld

Quoted 6 lines
   ---> Running in 11e755a7180b

Makefile:44: *** "Please define RTE_SDK environment variable". Stop. The command '/bin/sh -c make && cp build/helloworld-shared /usr/local/bin/helloworld' returned a non-zero code: 2

Missing define of RTE_SDK and RTE_TARGET?

Hi Ruifeng,

I think you run you run the command in dpdk/extras. However, this 'Dockerfile.dpdkSampleApp' is expected to be run in dpdk's root dir so that it is mounted as '/opt/dpdk' in the second step above. I have tested this Dockerfile on Ubuntu 18.04 and compiled without any error. RTE_SDK is set correctly, but dpdk's directory is not mounted in the container.

Quoted 4 lines

Hi Yasufumi,

I ran the command in dpdk root dir which should be correct.
The issue was due to shared library image not been correctly built. See below.

Hi Ruifeng,

I've misunderstood about RTE_SDK as Abdul said. Sorry.

Quoted 91 lines

Thanks.
/Ruifeng

Quoted 78 lines
Quoted 46 lines

Abdul,

Quoted 1 line
Quoted 1 line

+docker build -t ${DOCKERAPP_TAG} -f Dockerfile.dpdkSampleApp .

I think this line should be corrected as following, and make it clear it should be run in dpdk's root.

    docker build -t ${DOCKERAPP_TAG} -f extras/Dockerfile.dpdkSampleApp .

Even if the container image is built successfully, there is another problem in running app because it isn't run in privileged mode.

root@0d2a309dfd2c:/opt/dpdk/examples/helloworld# helloworld
EAL: Detected 16 lcore(s)
EAL: Detected 1 NUMA nodes
...
EAL: Failed to get current mempolicy: Operation not permitted.
Assuming MPOL_DEFAULT.
set_mempolicy: Operation not permitted
set_mempolicy: Operation not permitted
EAL: error allocating rte services array
EAL: FATAL: rte_service_init() failed
EAL: rte_service_init() failed
PANIC in main():
Cannot init EAL
5: [helloworld(+0x84a) [0x55555555484a]]
4: [/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)
[0x7ffff7721b97]]
3: [helloworld(+0x818) [0x555555554818]]
2:
[/usr/local/lib/x86_64-linux-gnu/librte_eal.so.20.1(__rte_panic+0xbd)
[0x7ffff7afb410]]
1:
[/usr/local/lib/x86_64-linux-gnu/librte_eal.so.20.1(rte_dump_stack+0x2
e)
[0x7ffff7b1598e]]
Aborted (core dumped)

I think '--privileged' option should be added to avoid the error.

$ docker run --rm --privileged -it  -v /dev/hugepages:/dev/hugepages
dpdk- helloworld

I have one more suggestion. You might have added $USER to docker group and run docker without sudo like as following.

Quoted 8 lines
$ sudo groupadd docker
$ sudo usermod -aG docker $USER

I wounder it is better to use sudo in your examples, or add the instruction for users not familiar with docker.

Regards,
Yasufumi

Hi Yasufumi,
Thank you for your feedback.
The steps for creating the sample app docker file explains that that we are creating the file at dpdk root directory. So the assumption here is the docker run command also run from there. Not sure if we need to repeat this later also.

The 'cat' command above creates the docker file in dpdk root directory for simplicity. Actually, we just needed the examples/helloworld source code from there. As for other user application, the docker file could be anywhere, not necessarily in dpdk tree at all. User need to run docker build from where their own docker file is.

The dpdk 'base' container should be used as shared-lib to build dpdk application with libdpdk. So, the dpdk source code, RTE_SDK or RTE_TARGET is not needed unless the pkg-config is unable to find libdpdk.

I will update the patch with suggested '--privileged' flag on docker run command.
Not sure if we should cover the docker permissions and docker specific configurations on this doc though. I am sure user can find those resources somewhere else if needed.

Quoted 8 lines

Hi Ruifeng,
Unfortunately I could not create Aarch64 environment to test this. Could you please run the following command in your env and see if you can get output as below:

$ docker run --rm dpdk pkg-config --list-all | grep libdpdk
libdpdk          DPDK - The Data Plane Development Kit (DPDK).

Hi Abdul,

Quoted 8 lines

Yes, the issue was due to pkg-config could not find libdpdk. I didn't get expected libdpdk info in pkg-config output.

Just found that even my building of dpdk shared library image was failed. Shared library image build failure was due to local 'build' directory in my dpdk source tree. And the 'build' impacted meson configuration in container.

Not sure if it is a worth to mention that base dpdk tree should be clean.

I am not sure the problem is always happened if the tree is not cleaned, but might be helpful.

Regards,
Yasufumi

Quoted 52 lines

With '--privileged' flag suggested by Yasufumi:

Thanks.
/Ruifeng

Quoted 46 lines

Regards,
Abdul

Quoted 27 lines
Quoted 27 lines
Quoted 27 lines
extras/README.md new file +3 -0
+
+This sample app now can be run like any other applicaiton in a
+docker

container.

extras/README.md new file +12 -1
+
+```
+$ docker run --rm -it  -v /dev/hugepages:/dev/hugepages
+dpdk-helloworld ```
+
+## Running the sample app
+Once inside the container run helloword binary
+
+```
+$ root@11233ed2e69c # helloworld
+```
+
--

1.8.3.1

--------------------------------------------------------------
Intel Research and Development Ireland Limited Registered in Ireland Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

--------------------------------------------------------------
Intel Research and Development Ireland Limited Registered in Ireland Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

#12 lore raw
In reply to Halim, Abdul

Hi Abdul,

Quoted 9 lines · Abdul
Quoted 9 lines

-----Original Message-----
From: Yasufumi Ogawa <[email protected]>
Sent: Thursday, December 5, 2019 7:52 PM
To: Ruifeng Wang (Arm Technology China) <[email protected]>; Halim, Abdul <[email protected]>; [email protected]
Cc: Kinsella, Ray <[email protected]>; nd <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v3] build: add dockerfile for building docker image

[...]

Quoted 92 lines
Quoted 77 lines
Quoted 5 lines

Hi Abdul,

I tried the steps on AArch64 platform, and hit error as below:

Quoted 11 lines
$ sudo docker build -t ${DOCKERAPP_TAG} -f Dockerfile.dpdkSampleApp .
Sending build context to Docker daemon   2.55GB
Step 1/4 : FROM dpdk
   ---> 955448007987
Step 2/4 : ADD . /opt/dpdk
   ---> d8b58019a7e2
Step 3/4 : WORKDIR /opt/dpdk/examples/helloworld
   ---> Running in 14fc89f7d3cd
Removing intermediate container 14fc89f7d3cd
   ---> 065a682c58fd
Step 4/4 : RUN make && cp build/helloworld-shared

/usr/local/bin/helloworld

Quoted 6 lines
   ---> Running in 11e755a7180b

Makefile:44: *** "Please define RTE_SDK environment variable". Stop. The command '/bin/sh -c make && cp build/helloworld-shared /usr/local/bin/helloworld' returned a non-zero code: 2

Missing define of RTE_SDK and RTE_TARGET?

Hi Ruifeng,

I think you run you run the command in dpdk/extras. However, this 'Dockerfile.dpdkSampleApp' is expected to be run in dpdk's root dir so that it is mounted as '/opt/dpdk' in the second step above. I have tested this Dockerfile on Ubuntu 18.04 and compiled without any error. RTE_SDK is set correctly, but dpdk's directory is not mounted in the container.

Abdul,

Quoted 1 line
Quoted 1 line

+docker build -t ${DOCKERAPP_TAG} -f Dockerfile.dpdkSampleApp .

I think this line should be corrected as following, and make it clear it should be run in dpdk's root.

    docker build -t ${DOCKERAPP_TAG} -f extras/Dockerfile.dpdkSampleApp .

Even if the container image is built successfully, there is another problem in running app because it isn't run in privileged mode.

root@0d2a309dfd2c:/opt/dpdk/examples/helloworld# helloworld
EAL: Detected 16 lcore(s)
EAL: Detected 1 NUMA nodes
...
EAL: Failed to get current mempolicy: Operation not permitted. Assuming
MPOL_DEFAULT.
set_mempolicy: Operation not permitted
set_mempolicy: Operation not permitted
EAL: error allocating rte services array
EAL: FATAL: rte_service_init() failed
EAL: rte_service_init() failed
PANIC in main():
Cannot init EAL
5: [helloworld(+0x84a) [0x55555555484a]]
4: [/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)
[0x7ffff7721b97]]
3: [helloworld(+0x818) [0x555555554818]]
2: [/usr/local/lib/x86_64-linux-gnu/librte_eal.so.20.1(__rte_panic+0xbd)
[0x7ffff7afb410]]
1:
[/usr/local/lib/x86_64-linux-gnu/librte_eal.so.20.1(rte_dump_stack+0x2e)
[0x7ffff7b1598e]]
Aborted (core dumped)

I think '--privileged' option should be added to avoid the error.

$ docker run --rm --privileged -it  -v /dev/hugepages:/dev/hugepages dpdk-
helloworld

I have one more suggestion. You might have added $USER to docker group and run docker without sudo like as following.

Quoted 8 lines
$ sudo groupadd docker
$ sudo usermod -aG docker $USER

I wounder it is better to use sudo in your examples, or add the instruction for users not familiar with docker.

Regards,
Yasufumi

Hi Yasufumi,
Thank you for your feedback.
The steps for creating the sample app docker file explains that that we are creating the file at dpdk root directory. So the assumption here is the docker run command also run from there. Not sure if we need to repeat this later also.

Quoted 5 lines

The 'cat' command above creates the docker file in dpdk
root directory for simplicity. Actually, we just needed the examples/helloworld source code from there. As for other user application, the docker file could be anywhere, not necessarily in dpdk tree at all. User need to run docker build from where their own docker file is.

Yes.

Quoted 4 lines

The dpdk 'base' container should be used as shared-lib to build dpdk application with libdpdk. So, the dpdk source code, RTE_SDK or RTE_TARGET is not needed unless the pkg-config is unable to find libdpdk.

Sorry, I mixed up with the case of using these env variables.

Quoted 5 lines

I will update the patch with suggested '--privileged' flag on docker run command. Not sure if we should cover the docker permissions and docker specific configurations on this doc though. I am sure user can find those resources somewhere else if needed.

OK. It is just a suggestion. I though that it is better to include basic usage concisely, but no need if user can find it easily.

Regards,
Yasufumi

Quoted 56 lines

Hi Ruifeng,
Unfortunately I could not create Aarch64 environment to test this. Could you please run the following command in your env and see if you can get output as below:

$ docker run --rm dpdk pkg-config --list-all | grep libdpdk
libdpdk          DPDK - The Data Plane Development Kit (DPDK).

Regards,
Abdul

Quoted 27 lines
Quoted 27 lines
Quoted 27 lines
(quoted diff) +3 -0
+
+This sample app now can be run like any other applicaiton in a
+docker

container.

extras/README.md new file +12 -1
+
+```
+$ docker run --rm -it  -v /dev/hugepages:/dev/hugepages
+dpdk-helloworld ```
+
+## Running the sample app
+Once inside the container run helloword binary
+
+```
+$ root@11233ed2e69c # helloworld
+```
+
--

1.8.3.1

--------------------------------------------------------------
Intel Research and Development Ireland Limited Registered in Ireland Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

#13 lore raw

Hi Yasufumi and Ruifeng,
Thanks for your feedback and verification.
I will update the patch with suggested changes and improve it little bit more to avoid the dirty build directory. Also, for the sample app I will copy examples/helloworld source code only in the docker file.

Regards,
Abdul

Quoted 142 lines

-----Original Message-----
From: Yasufumi Ogawa <[email protected]>
Sent: Monday, December 9, 2019 10:18 AM
To: Halim, Abdul <[email protected]>; Ruifeng Wang (Arm Technology China) <[email protected]>; [email protected]
Cc: Kinsella, Ray <[email protected]>; nd <[email protected]>; Richardson, Bruce <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v3] build: add dockerfile for building docker image

Hi Abdul,

Quoted 9 lines · Abdul
Quoted 9 lines

-----Original Message-----
From: Yasufumi Ogawa <[email protected]>
Sent: Thursday, December 5, 2019 7:52 PM
To: Ruifeng Wang (Arm Technology China) <[email protected]>; Halim, Abdul <[email protected]>; [email protected]
Cc: Kinsella, Ray <[email protected]>; nd <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v3] build: add dockerfile for building docker image

[...]

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Hi Abdul,

I tried the steps on AArch64 platform, and hit error as below:

$ sudo docker build -t ${DOCKERAPP_TAG} -f Dockerfile.dpdkSampleApp

.

Quoted 27 lines
Quoted 27 lines
Quoted 10 lines

Sending build context to Docker daemon 2.55GB
Step 1/4 : FROM dpdk
---> 955448007987
Step 2/4 : ADD . /opt/dpdk
---> d8b58019a7e2
Step 3/4 : WORKDIR /opt/dpdk/examples/helloworld
---> Running in 14fc89f7d3cd
Removing intermediate container 14fc89f7d3cd
---> 065a682c58fd
Step 4/4 : RUN make && cp build/helloworld-shared

/usr/local/bin/helloworld

Quoted 6 lines
   ---> Running in 11e755a7180b

Makefile:44: *** "Please define RTE_SDK environment variable". Stop. The command '/bin/sh -c make && cp build/helloworld-shared /usr/local/bin/helloworld' returned a non-zero code: 2

Missing define of RTE_SDK and RTE_TARGET?

Hi Ruifeng,

I think you run you run the command in dpdk/extras. However, this 'Dockerfile.dpdkSampleApp' is expected to be run in dpdk's root dir so that it is mounted as '/opt/dpdk' in the second step above. I have tested this Dockerfile on Ubuntu 18.04 and compiled without any error. RTE_SDK is set correctly, but dpdk's directory is not mounted in the container.

Quoted 8 lines
Quoted 8 lines

Abdul,

Quoted 1 line
Quoted 1 line

+docker build -t ${DOCKERAPP_TAG} -f Dockerfile.dpdkSampleApp .

I think this line should be corrected as following, and make it clear it should be run in dpdk's root.

    docker build -t ${DOCKERAPP_TAG} -f

extras/Dockerfile.dpdkSampleApp .

Quoted 44 lines
Quoted 44 lines

Even if the container image is built successfully, there is another problem in running app because it isn't run in privileged mode.

root@0d2a309dfd2c:/opt/dpdk/examples/helloworld# helloworld
EAL: Detected 16 lcore(s)
EAL: Detected 1 NUMA nodes
...
EAL: Failed to get current mempolicy: Operation not permitted.
Assuming MPOL_DEFAULT.
set_mempolicy: Operation not permitted
set_mempolicy: Operation not permitted
EAL: error allocating rte services array
EAL: FATAL: rte_service_init() failed
EAL: rte_service_init() failed
PANIC in main():
Cannot init EAL
5: [helloworld(+0x84a) [0x55555555484a]]
4: [/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)
[0x7ffff7721b97]]
3: [helloworld(+0x818) [0x555555554818]]
2:
[/usr/local/lib/x86_64-linux-gnu/librte_eal.so.20.1(__rte_panic+0xbd)
[0x7ffff7afb410]]
1:
[/usr/local/lib/x86_64-linux-gnu/librte_eal.so.20.1(rte_dump_stack+0x
2e)
[0x7ffff7b1598e]]
Aborted (core dumped)

I think '--privileged' option should be added to avoid the error.

$ docker run --rm --privileged -it  -v /dev/hugepages:/dev/hugepages
dpdk- helloworld

I have one more suggestion. You might have added $USER to docker group and run docker without sudo like as following.

$ sudo groupadd docker
$ sudo usermod -aG docker $USER

I wounder it is better to use sudo in your examples, or add the instruction for users not familiar with docker.

Quoted 8 lines
Quoted 2 lines

Regards,
Yasufumi

Hi Yasufumi,
Thank you for your feedback.
The steps for creating the sample app docker file explains that that we are creating the file at dpdk root directory. So the assumption here is the docker run command also run from there. Not sure if we need

to repeat this later also.

Quoted 6 lines

The 'cat' command above creates the docker file in dpdk root directory for simplicity. Actually, we just needed the examples/helloworld source code from there. As for other user application, the docker file could be anywhere, not necessarily in dpdk tree at all. User need to run docker build from where their own docker file is.

Yes.

Quoted 4 lines

The dpdk 'base' container should be used as shared-lib to build dpdk application with libdpdk. So, the dpdk source code, RTE_SDK or RTE_TARGET is not needed unless the pkg-config is unable to find libdpdk.

Sorry, I mixed up with the case of using these env variables.

Quoted 2 lines

I will update the patch with suggested '--privileged' flag on docker run

command.

Quoted 3 lines

Not sure if we should cover the docker permissions and docker specific configurations on this doc though. I am sure user can find those resources somewhere else if needed.

OK. It is just a suggestion. I though that it is better to include basic usage concisely, but no need if user can find it easily.

Quoted 58 lines

Regards,
Yasufumi

Quoted 4 lines

Hi Ruifeng,
Unfortunately I could not create Aarch64 environment to test this. Could you please run the following command in your env and see if you can

get output as below:

Quoted 51 lines
$ docker run --rm dpdk pkg-config --list-all | grep libdpdk
libdpdk          DPDK - The Data Plane Development Kit (DPDK).

Regards,
Abdul

Quoted 27 lines
Quoted 27 lines
Quoted 27 lines
(quoted diff) +3 -0
+
+This sample app now can be run like any other applicaiton in a
+docker

container.

extras/README.md new file +12 -1
+
+```
+$ docker run --rm -it  -v /dev/hugepages:/dev/hugepages
+dpdk-helloworld ```
+
+## Running the sample app
+Once inside the container run helloword binary
+
+```
+$ root@11233ed2e69c # helloworld
+```
+
--

1.8.3.1

--------------------------------------------------------------
Intel Research and Development Ireland Limited Registered in Ireland Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

--------------------------------------------------------------
Intel Research and Development Ireland Limited Registered in Ireland Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

#14 lore raw

PATCH v4 1/1 build: add dockerfile for building docker image

In reply to Abdul Halim

Adding a Dockerfile with Ubuntu bionic base image to build dpdk as shared library. This docker image could be used as base image to build and run dpdk applications in containers.

---

v2:
* renamed Dockerfile name from Dockerfile.ubuntu to Dockerfile.bionic
* added call to ldconfig to update cache of libraries to include newly installed DPDK libs

---

v3:
* added example use-case of dpdk dockerfile in extras/README.md

---
v4:
* changed meson build to use tmp dir in docker build
* changed sample app dockerfile to add only helloworld source code

---
 extras/Dockerfile.bionic | 40 +++++++++++++++++++++++++++++++++++++
 extras/README.md         | 51 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 91 insertions(+)
 create mode 100644 extras/Dockerfile.bionic
 create mode 100644 extras/README.md
extras/Dockerfile.bionic new file +40 -0
new file mode 100644
index 0000000..cf9c176
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019 Intel Corporation
+FROM ubuntu:bionic
+
+# install requirements for getting and building DPDK
+# including dependencies for DPDK features
+RUN apt-get update && apt-get install -y \
+    build-essential \
+    pkg-config \
+    python3 \
+    python3-pip \
+    ninja-build \
+    libjansson-dev \
+    libbsd-dev \
+    libnuma-dev \
+    libssl-dev \
+    zlib1g-dev \
+    libpcap-dev \
+    libibverbs-dev \
+        && pip3 install meson \
+        && apt-get clean && rm -rf /var/lib/apt/lists/*
+
+ADD . /tmp/dpdk
+
+WORKDIR /tmp/dpdk
+
+RUN meson /tmp/dpdk-build \
+    -Ddefault_library=shared \
+    -Dmachine=default \
+    -Dper_library_versions=false \
+        && ninja -C /tmp/dpdk-build install \
+        && ldconfig \
+        && cd /; rm -rf /tmp/dpdk
+
+WORKDIR /
+
+# Installed DPDK Shared library location:
+# lib dir : /usr/local/lib/
+# include : /usr/local/include/
+# pkgconfig file: /usr/local/lib/x86_64-linux-gnu/pkgconfig/libdpdk.pc
extras/README.md new file +51 -0

51 lines not on this page · raw message

Signature · 13 lines
1.8.3.1

--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263


This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.
#15 lore raw

PATCH v5 1/1 build: add dockerfile for building docker image

In reply to Abdul Halim

Adding a Dockerfile with Ubuntu bionic base image to build dpdk as shared library. This docker image could be used as base image to build and run dpdk applications in containers.

---

v2:
* renamed Dockerfile name from Dockerfile.ubuntu to Dockerfile.bionic
* added call to ldconfig to update cache of libraries to include newly installed DPDK libs

---

v3:
* added example use-case of dpdk dockerfile in extras/README.md

---
v4:
* changed meson build to use tmp dir in docker build
* changed sample app dockerfile to add only helloworld source code

---
v5:
* fix whitespace error

---
 extras/Dockerfile.bionic | 40 +++++++++++++++++++++++++++++++++++++
 extras/README.md         | 51 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 91 insertions(+)
 create mode 100644 extras/Dockerfile.bionic
 create mode 100644 extras/README.md
extras/Dockerfile.bionic new file +40 -0
new file mode 100644
index 0000000..cf9c176
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019 Intel Corporation
+FROM ubuntu:bionic
+
+# install requirements for getting and building DPDK
+# including dependencies for DPDK features
+RUN apt-get update && apt-get install -y \
+    build-essential \
+    pkg-config \
+    python3 \
+    python3-pip \
+    ninja-build \
+    libjansson-dev \
+    libbsd-dev \
+    libnuma-dev \
+    libssl-dev \
+    zlib1g-dev \
+    libpcap-dev \
+    libibverbs-dev \
+        && pip3 install meson \
+        && apt-get clean && rm -rf /var/lib/apt/lists/*
+
+ADD . /tmp/dpdk
+
+WORKDIR /tmp/dpdk
+
+RUN meson /tmp/dpdk-build \
+    -Ddefault_library=shared \
+    -Dmachine=default \
+    -Dper_library_versions=false \
+        && ninja -C /tmp/dpdk-build install \
+        && ldconfig \
+        && cd /; rm -rf /tmp/dpdk
+
+WORKDIR /
+
+# Installed DPDK Shared library location:
+# lib dir : /usr/local/lib/
+# include : /usr/local/include/
+# pkgconfig file: /usr/local/lib/x86_64-linux-gnu/pkgconfig/libdpdk.pc
extras/README.md new file +51 -0

51 lines not on this page · raw message

Signature · 13 lines
1.8.3.1

--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263


This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.
#16 lore raw
Quoted 127 lines · Abdul Halim

Adding a Dockerfile with Ubuntu bionic base image to build dpdk as shared library. This docker image could be used as base image to build and run dpdk applications in containers.

---

v2:
* renamed Dockerfile name from Dockerfile.ubuntu to Dockerfile.bionic
* added call to ldconfig to update cache of libraries to include newly installed DPDK libs

---

v3:
* added example use-case of dpdk dockerfile in extras/README.md

---
v4:
* changed meson build to use tmp dir in docker build
* changed sample app dockerfile to add only helloworld source code

---
v5:
* fix whitespace error

---
 extras/Dockerfile.bionic | 40 +++++++++++++++++++++++++++++++++++++
 extras/README.md         | 51 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 91 insertions(+)
 create mode 100644 extras/Dockerfile.bionic
 create mode 100644 extras/README.md
extras/Dockerfile.bionic new file +40 -0
new file mode 100644
index 0000000..cf9c176
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019 Intel Corporation
+FROM ubuntu:bionic
+
+# install requirements for getting and building DPDK
+# including dependencies for DPDK features
+RUN apt-get update && apt-get install -y \
+    build-essential \
+    pkg-config \
+    python3 \
+    python3-pip \
+    ninja-build \
+    libjansson-dev \
+    libbsd-dev \
+    libnuma-dev \
+    libssl-dev \
+    zlib1g-dev \
+    libpcap-dev \
+    libibverbs-dev \
+        && pip3 install meson \
+        && apt-get clean && rm -rf /var/lib/apt/lists/*
+
+ADD . /tmp/dpdk
+
+WORKDIR /tmp/dpdk
+
+RUN meson /tmp/dpdk-build \
+    -Ddefault_library=shared \
+    -Dmachine=default \
+    -Dper_library_versions=false \
+        && ninja -C /tmp/dpdk-build install \
+        && ldconfig \
+        && cd /; rm -rf /tmp/dpdk
+
+WORKDIR /
+
+# Installed DPDK Shared library location:
+# lib dir : /usr/local/lib/
+# include : /usr/local/include/
+# pkgconfig file: /usr/local/lib/x86_64-linux-gnu/pkgconfig/libdpdk.pc
extras/README.md new file +41 -0
new file mode 100644
index 0000000..8001012
@@ -0,0 +1,51 @@
+# Build DPDK Docker image
+
+To build a docker image run the following command from dpdk root directory.
+
+```
+DOCKER_TAG="dpdk"
+docker build -t ${DOCKER_TAG} -f extras/Dockerfile.bionic .
+```
+
+# Example of how to use this dpdk library image
+
+The following steps shows how to use the dpdk shared library container to build
+and run a dpdk application without having to build dpdk library for each
+application.
+
+## Create a dpdk sample app docker file with 'dpdk' as the base image
+
+Create a docker file to build the helloworld application from example/helloworld
+source files in dpdk root directory.
+
+```
+cat << EOF > Dockerfile.dpdkSampleApp
+FROM dpdk
+
+ADD examples/helloworld /opt/examples/helloworld
+
+WORKDIR /opt/examples/helloworld
+RUN make && cp build/helloworld-shared /usr/local/bin/helloworld
+EOF
+```
+
+## Build sample app docker image
+
+```
+DOCKERAPP_TAG="dpdk-helloworld"
+docker build -t ${DOCKERAPP_TAG} -f Dockerfile.dpdkSampleApp .
+```
+
+This sample app now can be run like any other applicaiton in a docker container.
+
+```

extras/README.md line 51

Quoted 10 lines
extras/README.md new file +10 -0
+$ docker run --rm --privileged -it  -v /dev/hugepages:/dev/hugepages dpdk-helloworld
+```
+
+## Running the sample app
+Once inside the container run helloword binary
+
+```
+$ root@11233ed2e69c # helloworld
+```
+

Hi Abdul,

Other's feel free to shoot me down.
But I am not sure that HelloWorld is really the example we want to show here.

HelloWorld is good and it minimizes the associated config you need to describe.
However does it really help a someone get started running DPDK in a container, as there is no network interface.

Is there anyway we could show something running on a network interface? Perhaps we contrive something simple with vEth, AF_Packet and TestPMD?

Ray K

#17 lore raw
Quoted 162 lines

-----Original Message-----
From: Ray Kinsella <[email protected]>
Sent: Tuesday, December 10, 2019 5:45 PM
To: [email protected]; Halim, Abdul <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v5] build: add dockerfile for building docker image

Quoted 23 lines · Abdul Halim

Adding a Dockerfile with Ubuntu bionic base image to build dpdk as shared library. This docker image could be used as base image to build and run dpdk applications in containers.

---

v2:
* renamed Dockerfile name from Dockerfile.ubuntu to Dockerfile.bionic
* added call to ldconfig to update cache of libraries to include newly installed DPDK libs

---

v3:
* added example use-case of dpdk dockerfile in extras/README.md

---
v4:
* changed meson build to use tmp dir in docker build
* changed sample app dockerfile to add only helloworld source code

Quoted 5 lines

---
v5:
* fix whitespace error

---
 extras/Dockerfile.bionic | 40

+++++++++++++++++++++++++++++++++++++

Quoted 1 line
 extras/README.md         | 51

++++++++++++++++++++++++++++++++++++++++++++++++

extras/README.md new file mode

Quoted 50 lines
 2 files changed, 91 insertions(+)
 create mode 100644 extras/Dockerfile.bionic  create mode 100644

extras/README.md

extras/Dockerfile.bionic new renamed from extras/Dockerfile.bionic +0 -0

file mode 100644 index 0000000..cf9c176

extras/Dockerfile.bionic new file +40 -0
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2019 Intel
+Corporation FROM ubuntu:bionic
+
+# install requirements for getting and building DPDK # including
+dependencies for DPDK features RUN apt-get update && apt-get install
+-y \
+    build-essential \
+    pkg-config \
+    python3 \
+    python3-pip \
+    ninja-build \
+    libjansson-dev \
+    libbsd-dev \
+    libnuma-dev \
+    libssl-dev \
+    zlib1g-dev \
+    libpcap-dev \
+    libibverbs-dev \
+        && pip3 install meson \
+        && apt-get clean && rm -rf /var/lib/apt/lists/*
+
+ADD . /tmp/dpdk
+
+WORKDIR /tmp/dpdk
+
+RUN meson /tmp/dpdk-build \
+    -Ddefault_library=shared \
+    -Dmachine=default \
+    -Dper_library_versions=false \
+        && ninja -C /tmp/dpdk-build install \
+        && ldconfig \
+        && cd /; rm -rf /tmp/dpdk
+
+WORKDIR /
+
+# Installed DPDK Shared library location:
+# lib dir : /usr/local/lib/
+# include : /usr/local/include/
+# pkgconfig file:
+/usr/local/lib/x86_64-linux-gnu/pkgconfig/libdpdk.pc
extras/README.md new file mode renamed from extras/README.md +0 -0

100644

extras/README.md line 3

Quoted 7 lines

index 0000000..8001012

extras/README.md new file +3 -0
@@ -0,0 +1,51 @@
+# Build DPDK Docker image
+
+To build a docker image run the following command from dpdk root

directory.

Quoted 24 lines
extras/README.md new file +24 -0
+
+```
+DOCKER_TAG="dpdk"
+docker build -t ${DOCKER_TAG} -f extras/Dockerfile.bionic .
+```
+
+# Example of how to use this dpdk library image
+
+The following steps shows how to use the dpdk shared library
+container to build and run a dpdk application without having to build
+dpdk library for each application.
+
+## Create a dpdk sample app docker file with 'dpdk' as the base image
+
+Create a docker file to build the helloworld application from
+example/helloworld source files in dpdk root directory.
+
+```
+cat << EOF > Dockerfile.dpdkSampleApp FROM dpdk
+
+ADD examples/helloworld /opt/examples/helloworld
+
+WORKDIR /opt/examples/helloworld
+RUN make && cp build/helloworld-shared /usr/local/bin/helloworld EOF

extras/README.md

Quoted 10 lines
extras/README.md new file +10 -0
+```
+
+## Build sample app docker image
+
+```
+DOCKERAPP_TAG="dpdk-helloworld"
+docker build -t ${DOCKERAPP_TAG} -f Dockerfile.dpdkSampleApp .
+```
+
+This sample app now can be run like any other applicaiton in a docker

container.

extras/README.md line 51

Quoted 13 lines
extras/README.md new file +12 -0
+
+```
+$ docker run --rm --privileged -it  -v /dev/hugepages:/dev/hugepages
+dpdk-helloworld ```
+
+## Running the sample app
+Once inside the container run helloword binary
+
+```
+$ root@11233ed2e69c # helloworld
+```
+

Hi Abdul,

Other's feel free to shoot me down.
But I am not sure that HelloWorld is really the example we want to show here.

HelloWorld is good and it minimizes the associated config you need to describe.
However does it really help a someone get started running DPDK in a container, as there is no network interface.

Quoted 4 lines

Is there anyway we could show something running on a network interface? Perhaps we contrive something simple with vEth, AF_Packet and TestPMD?

Ray K

Hi Ray,
Our intent here is to show how to use this dpdk shared lib in container to build an application and run it. The same steps can be taken for any other advanced DPDK apps to take advantage of this shared library.
As you've mentioned, other apps will require various HW related configuration to be shown and explained. The DPDK documentation already cover them in details. And that may unintentionally divert the focus to that particular app. This is my opinion only :)

However, if you strongly feel that the example should be with one of the apps you've mentioned I can update it accordingly.

Many thanks!

Regards,
Abdul
--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

#18 lore raw
Quoted 176 lines · Abdul
Quoted 162 lines

-----Original Message-----
From: Ray Kinsella <[email protected]>
Sent: Tuesday, December 10, 2019 5:45 PM
To: [email protected]; Halim, Abdul <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v5] build: add dockerfile for building docker image

Quoted 23 lines · Abdul Halim

Adding a Dockerfile with Ubuntu bionic base image to build dpdk as shared library. This docker image could be used as base image to build and run dpdk applications in containers.

---

v2:
* renamed Dockerfile name from Dockerfile.ubuntu to Dockerfile.bionic
* added call to ldconfig to update cache of libraries to include newly installed DPDK libs

---

v3:
* added example use-case of dpdk dockerfile in extras/README.md

---
v4:
* changed meson build to use tmp dir in docker build
* changed sample app dockerfile to add only helloworld source code

Quoted 5 lines

---
v5:
* fix whitespace error

---
 extras/Dockerfile.bionic | 40

+++++++++++++++++++++++++++++++++++++

Quoted 1 line
 extras/README.md         | 51

++++++++++++++++++++++++++++++++++++++++++++++++

extras/README.md new file mode

Quoted 50 lines
 2 files changed, 91 insertions(+)
 create mode 100644 extras/Dockerfile.bionic  create mode 100644

extras/README.md

extras/Dockerfile.bionic new renamed from extras/Dockerfile.bionic +0 -0

file mode 100644 index 0000000..cf9c176

extras/Dockerfile.bionic new file +40 -0
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2019 Intel
+Corporation FROM ubuntu:bionic
+
+# install requirements for getting and building DPDK # including
+dependencies for DPDK features RUN apt-get update && apt-get install
+-y \
+    build-essential \
+    pkg-config \
+    python3 \
+    python3-pip \
+    ninja-build \
+    libjansson-dev \
+    libbsd-dev \
+    libnuma-dev \
+    libssl-dev \
+    zlib1g-dev \
+    libpcap-dev \
+    libibverbs-dev \
+        && pip3 install meson \
+        && apt-get clean && rm -rf /var/lib/apt/lists/*
+
+ADD . /tmp/dpdk
+
+WORKDIR /tmp/dpdk
+
+RUN meson /tmp/dpdk-build \
+    -Ddefault_library=shared \
+    -Dmachine=default \
+    -Dper_library_versions=false \
+        && ninja -C /tmp/dpdk-build install \
+        && ldconfig \
+        && cd /; rm -rf /tmp/dpdk
+
+WORKDIR /
+
+# Installed DPDK Shared library location:
+# lib dir : /usr/local/lib/
+# include : /usr/local/include/
+# pkgconfig file:
+/usr/local/lib/x86_64-linux-gnu/pkgconfig/libdpdk.pc
extras/README.md new file mode renamed from extras/README.md +0 -0

100644

extras/README.md line 3

Quoted 7 lines

index 0000000..8001012

extras/README.md new file +3 -0
@@ -0,0 +1,51 @@
+# Build DPDK Docker image
+
+To build a docker image run the following command from dpdk root

directory.

Quoted 24 lines
extras/README.md new file +24 -0
+
+```
+DOCKER_TAG="dpdk"
+docker build -t ${DOCKER_TAG} -f extras/Dockerfile.bionic .
+```
+
+# Example of how to use this dpdk library image
+
+The following steps shows how to use the dpdk shared library
+container to build and run a dpdk application without having to build
+dpdk library for each application.
+
+## Create a dpdk sample app docker file with 'dpdk' as the base image
+
+Create a docker file to build the helloworld application from
+example/helloworld source files in dpdk root directory.
+
+```
+cat << EOF > Dockerfile.dpdkSampleApp FROM dpdk
+
+ADD examples/helloworld /opt/examples/helloworld
+
+WORKDIR /opt/examples/helloworld
+RUN make && cp build/helloworld-shared /usr/local/bin/helloworld EOF

extras/README.md

Quoted 10 lines
extras/README.md new file +10 -0
+```
+
+## Build sample app docker image
+
+```
+DOCKERAPP_TAG="dpdk-helloworld"
+docker build -t ${DOCKERAPP_TAG} -f Dockerfile.dpdkSampleApp .
+```
+
+This sample app now can be run like any other applicaiton in a docker

container.

extras/README.md line 51

Quoted 13 lines
extras/README.md new file +12 -0
+
+```
+$ docker run --rm --privileged -it  -v /dev/hugepages:/dev/hugepages
+dpdk-helloworld ```
+
+## Running the sample app
+Once inside the container run helloword binary
+
+```
+$ root@11233ed2e69c # helloworld
+```
+

Hi Abdul,

Other's feel free to shoot me down.
But I am not sure that HelloWorld is really the example we want to show here.

HelloWorld is good and it minimizes the associated config you need to describe.
However does it really help a someone get started running DPDK in a container, as there is no network interface.

Quoted 4 lines

Is there anyway we could show something running on a network interface? Perhaps we contrive something simple with vEth, AF_Packet and TestPMD?

Ray K

Hi Ray,
Our intent here is to show how to use this dpdk shared lib in container to build an application and run it. The same steps can be taken for any other advanced DPDK apps to take advantage of this shared library.
As you've mentioned, other apps will require various HW related configuration to be shown and explained. The DPDK documentation already cover them in details. And that may unintentionally divert the focus to that particular app. This is my opinion only :)

Quoted 7 lines

However, if you strongly feel that the example should be with one of the apps you've mentioned I can update it accordingly.

Many thanks!

Regards,
Abdul

My simple point is that DPDK without a network card, is not the majority use case. Dataplane Development Kit implies some sort of a network data plane :-)

Thanks,

Ray K

#19 lore raw
Quoted 18 lines · On Wed, 11 Dec 2019 17:00:14 +0000 Ray Kinsella <[email protected]> wrote:
Quoted 10 lines

Hi Ray,
Our intent here is to show how to use this dpdk shared lib in container to build an application and run it. The same steps can be taken for any other advanced DPDK apps to take advantage of this shared library.
As you've mentioned, other apps will require various HW related configuration to be shown and explained. The DPDK documentation already cover them in details. And that may unintentionally divert the focus to that particular app. This is my opinion only :)

Quoted 7 lines

However, if you strongly feel that the example should be with one of the apps you've mentioned I can update it accordingly.

Many thanks!

Regards,
Abdul

Quoted 6 lines

My simple point is that DPDK without a network card, is not the majority use case. Dataplane Development Kit implies some sort of a network data plane :-)

Thanks,

Ray K

Have to agree with Ray here. The DPDK build process is complex and robust enough as is. Unless someone wants to go farther with container based build, it doesn't look like this patch got any traction in 4 years so dropping it.

#20 lore raw
In reply to Abdul Halim
Quoted 72 lines

-----Original Message-----
From: Abdul Halim <[email protected]>
Sent: Tuesday, December 10, 2019 21:55
To: [email protected]
Cc: [email protected]; [email protected]; Ruifeng Wang (Arm Technology China) <[email protected]>; Abdul Halim <[email protected]>
Subject: [PATCH v5] build: add dockerfile for building docker image

Adding a Dockerfile with Ubuntu bionic base image to build dpdk as shared library. This docker image could be used as base image to build and run dpdk applications in containers.

---

v2:
* renamed Dockerfile name from Dockerfile.ubuntu to Dockerfile.bionic
* added call to ldconfig to update cache of libraries to include newly installed DPDK libs

---

v3:
* added example use-case of dpdk dockerfile in extras/README.md

---
v4:
* changed meson build to use tmp dir in docker build
* changed sample app dockerfile to add only helloworld source code

---
v5:
* fix whitespace error

---
 extras/Dockerfile.bionic | 40
+++++++++++++++++++++++++++++++++++++
 extras/README.md         | 51
++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 91 insertions(+)
 create mode 100644 extras/Dockerfile.bionic  create mode 100644

extras/README.md

extras/Dockerfile.bionic new file mode renamed from extras/Dockerfile.bionic +0 -0

100644 index 0000000..cf9c176

extras/Dockerfile.bionic new file +22 -0
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2019 Intel
+Corporation FROM ubuntu:bionic
+
+# install requirements for getting and building DPDK # including
+dependencies for DPDK features RUN apt-get update && apt-get install -y
+\
+    build-essential \
+    pkg-config \
+    python3 \
+    python3-pip \
+    ninja-build \
+    libjansson-dev \
+    libbsd-dev \
+    libnuma-dev \
+    libssl-dev \
+    zlib1g-dev \
+    libpcap-dev \
+    libibverbs-dev \
+        && pip3 install meson \
+        && apt-get clean && rm -rf /var/lib/apt/lists/*
+
+ADD . /tmp/dpdk

extras/Dockerfile.bionic line 32

Quoted 10 lines
extras/Dockerfile.bionic new file +10 -0
+
+WORKDIR /tmp/dpdk
+
+RUN meson /tmp/dpdk-build \
+    -Ddefault_library=shared \
+    -Dmachine=default \
+    -Dper_library_versions=false \
+        && ninja -C /tmp/dpdk-build install \
+        && ldconfig \
+        && cd /; rm -rf /tmp/dpdk

You may want to rm /tmp/dpdk-build as well.

Regards,
/Ruifeng

Quoted 77 lines
extras/Dockerfile.bionic new file +7 -0
+
+WORKDIR /
+
+# Installed DPDK Shared library location:
+# lib dir : /usr/local/lib/
+# include : /usr/local/include/
+# pkgconfig file: /usr/local/lib/x86_64-linux-gnu/pkgconfig/libdpdk.pc
extras/README.md new file +3 -0
index 0000000..8001012
@@ -0,0 +1,51 @@
+# Build DPDK Docker image
+
+To build a docker image run the following command from dpdk root

directory.

extras/README.md new file +35 -0
+
+```
+DOCKER_TAG="dpdk"
+docker build -t ${DOCKER_TAG} -f extras/Dockerfile.bionic .
+```
+
+# Example of how to use this dpdk library image
+
+The following steps shows how to use the dpdk shared library container
+to build and run a dpdk application without having to build dpdk
+library for each application.
+
+## Create a dpdk sample app docker file with 'dpdk' as the base image
+
+Create a docker file to build the helloworld application from
+example/helloworld source files in dpdk root directory.
+
+```
+cat << EOF > Dockerfile.dpdkSampleApp
+FROM dpdk
+
+ADD examples/helloworld /opt/examples/helloworld
+
+WORKDIR /opt/examples/helloworld
+RUN make && cp build/helloworld-shared /usr/local/bin/helloworld EOF
+```
+
+## Build sample app docker image
+
+```
+DOCKERAPP_TAG="dpdk-helloworld"
+docker build -t ${DOCKERAPP_TAG} -f Dockerfile.dpdkSampleApp .
+```
+
+This sample app now can be run like any other applicaiton in a docker

container.

extras/README.md new file +12 -1
+
+```
+$ docker run --rm --privileged -it  -v /dev/hugepages:/dev/hugepages
+dpdk-helloworld ```
+
+## Running the sample app
+Once inside the container run helloword binary
+
+```
+$ root@11233ed2e69c # helloworld
+```
+
--

1.8.3.1

--------------------------------------------------------------
Intel Research and Development Ireland Limited Registered in Ireland Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

#21 lore raw
Quoted 87 lines

-----Original Message-----
From: Ruifeng Wang (Arm Technology China) <[email protected]>
Sent: Wednesday, December 11, 2019 6:45 AM
To: Halim, Abdul <[email protected]>; [email protected]
Cc: Kinsella, Ray <[email protected]>; [email protected]; nd <[email protected]>
Subject: RE: [PATCH v5] build: add dockerfile for building docker image

Quoted 76 lines

-----Original Message-----
From: Abdul Halim <[email protected]>
Sent: Tuesday, December 10, 2019 21:55
To: [email protected]
Cc: [email protected]; [email protected]; Ruifeng Wang (Arm Technology China) <[email protected]>; Abdul Halim <[email protected]>
Subject: [PATCH v5] build: add dockerfile for building docker image

Adding a Dockerfile with Ubuntu bionic base image to build dpdk as shared library. This docker image could be used as base image to build and run dpdk applications in containers.

---

v2:
* renamed Dockerfile name from Dockerfile.ubuntu to Dockerfile.bionic
* added call to ldconfig to update cache of libraries to include newly installed DPDK libs

---

v3:
* added example use-case of dpdk dockerfile in extras/README.md

---
v4:
* changed meson build to use tmp dir in docker build
* changed sample app dockerfile to add only helloworld source code

---
v5:
* fix whitespace error

---
 extras/Dockerfile.bionic | 40
+++++++++++++++++++++++++++++++++++++
 extras/README.md         | 51
++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 91 insertions(+)
 create mode 100644 extras/Dockerfile.bionic  create mode 100644

extras/README.md

extras/Dockerfile.bionic new renamed from extras/Dockerfile.bionic +0 -0

file mode
100644 index 0000000..cf9c176

extras/Dockerfile.bionic new file +26 -0
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2019 Intel
+Corporation FROM ubuntu:bionic
+
+# install requirements for getting and building DPDK # including
+dependencies for DPDK features RUN apt-get update && apt-get install
+-y \
+    build-essential \
+    pkg-config \
+    python3 \
+    python3-pip \
+    ninja-build \
+    libjansson-dev \
+    libbsd-dev \
+    libnuma-dev \
+    libssl-dev \
+    zlib1g-dev \
+    libpcap-dev \
+    libibverbs-dev \
+        && pip3 install meson \
+        && apt-get clean && rm -rf /var/lib/apt/lists/*
+
+ADD . /tmp/dpdk
+
+WORKDIR /tmp/dpdk
+
+RUN meson /tmp/dpdk-build \
Quoted 8 lines

extras/Dockerfile.bionic line 33

Quoted 6 lines
extras/Dockerfile.bionic new file +6 -0
+    -Ddefault_library=shared \
+    -Dmachine=default \
+    -Dper_library_versions=false \
+        && ninja -C /tmp/dpdk-build install \
+        && ldconfig \
+        && cd /; rm -rf /tmp/dpdk

You may want to rm /tmp/dpdk-build as well.

Sure, I'll update the patch.

Quoted 77 lines

Regards,
/Ruifeng

extras/README.md new file mode

Quoted 9 lines
extras/Dockerfile.bionic new file +8 -0
+
+WORKDIR /
+
+# Installed DPDK Shared library location:
+# lib dir : /usr/local/lib/
+# include : /usr/local/include/
+# pkgconfig file:
+/usr/local/lib/x86_64-linux-gnu/pkgconfig/libdpdk.pc
extras/README.md new file mode renamed from extras/README.md +0 -0

100644

Quoted 64 lines

index 0000000..8001012

extras/README.md new file +3 -0
@@ -0,0 +1,51 @@
+# Build DPDK Docker image
+
+To build a docker image run the following command from dpdk root

directory.

extras/README.md new file +34 -0
+
+```
+DOCKER_TAG="dpdk"
+docker build -t ${DOCKER_TAG} -f extras/Dockerfile.bionic .
+```
+
+# Example of how to use this dpdk library image
+
+The following steps shows how to use the dpdk shared library
+container to build and run a dpdk application without having to build
+dpdk library for each application.
+
+## Create a dpdk sample app docker file with 'dpdk' as the base image
+
+Create a docker file to build the helloworld application from
+example/helloworld source files in dpdk root directory.
+
+```
+cat << EOF > Dockerfile.dpdkSampleApp FROM dpdk
+
+ADD examples/helloworld /opt/examples/helloworld
+
+WORKDIR /opt/examples/helloworld
+RUN make && cp build/helloworld-shared /usr/local/bin/helloworld EOF
+```
+
+## Build sample app docker image
+
+```
+DOCKERAPP_TAG="dpdk-helloworld"
+docker build -t ${DOCKERAPP_TAG} -f Dockerfile.dpdkSampleApp .
+```
+
+This sample app now can be run like any other applicaiton in a docker

container.

extras/README.md new file +12 -1
+
+```
+$ docker run --rm --privileged -it  -v /dev/hugepages:/dev/hugepages
+dpdk-helloworld ```
+
+## Running the sample app
+Once inside the container run helloword binary
+
+```
+$ root@11233ed2e69c # helloworld
+```
+
--

1.8.3.1

--------------------------------------------------------------
Intel Research and Development Ireland Limited Registered in Ireland Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263

Quoted 4 lines
Quoted 4 lines

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

#22 lore raw

PATCH v6 1/1 build: add dockerfile for building docker image

In reply to Abdul Halim

Adding a Dockerfile with Ubuntu bionic base image to build dpdk as shared library. This docker image could be used as base image to build and run dpdk applications in containers.

---

v2:
* renamed Dockerfile name from Dockerfile.ubuntu to Dockerfile.bionic
* added call to ldconfig to update cache of libraries to include newly installed DPDK libs

---

v3:
* added example use-case of dpdk dockerfile in extras/README.md

---
v4:
* changed meson build to use tmp dir in docker build
* changed sample app dockerfile to add only helloworld source code

---
v5:
* fix whitespace error

---
v6:
* clean up temp build directory

---
 extras/Dockerfile.bionic | 40 +++++++++++++++++++++++++++++++++++++
 extras/README.md         | 51 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 91 insertions(+)
 create mode 100644 extras/Dockerfile.bionic
 create mode 100644 extras/README.md
extras/Dockerfile.bionic new file +40 -0
new file mode 100644
index 0000000..08b4c60
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019 Intel Corporation
+FROM ubuntu:bionic
+
+# install requirements for getting and building DPDK
+# including dependencies for DPDK features
+RUN apt-get update && apt-get install -y \
+    build-essential \
+    pkg-config \
+    python3 \
+    python3-pip \
+    ninja-build \
+    libjansson-dev \
+    libbsd-dev \
+    libnuma-dev \
+    libssl-dev \
+    zlib1g-dev \
+    libpcap-dev \
+    libibverbs-dev \
+        && pip3 install meson \
+        && apt-get clean && rm -rf /var/lib/apt/lists/*
+
+ADD . /tmp/dpdk
+
+WORKDIR /tmp/dpdk
+
+RUN meson /tmp/dpdk-build \
+    -Ddefault_library=shared \
+    -Dmachine=default \
+    -Dper_library_versions=false \
+        && ninja -C /tmp/dpdk-build install \
+        && ldconfig \
+        && cd /; rm -rf /tmp/dpdk /tmp/dpdk-build
+
+WORKDIR /
+
+# Installed DPDK Shared library location:
+# lib dir : /usr/local/lib/
+# include : /usr/local/include/
+# pkgconfig file: /usr/local/lib/x86_64-linux-gnu/pkgconfig/libdpdk.pc
extras/README.md new file +51 -0

51 lines not on this page · raw message

Signature · 13 lines
1.8.3.1

--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263


This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.
#23 lore raw
Quoted 39 lines

-----Original Message-----
From: Abdul Halim <[email protected]>
Sent: Thursday, December 12, 2019 00:39
To: [email protected]
Cc: [email protected]; [email protected]; Ruifeng Wang (Arm Technology China) <[email protected]>; Abdul Halim <[email protected]>
Subject: [PATCH v6] build: add dockerfile for building docker image

Adding a Dockerfile with Ubuntu bionic base image to build dpdk as shared library. This docker image could be used as base image to build and run dpdk applications in containers.

---

v2:
* renamed Dockerfile name from Dockerfile.ubuntu to Dockerfile.bionic
* added call to ldconfig to update cache of libraries to include newly installed DPDK libs

---

v3:
* added example use-case of dpdk dockerfile in extras/README.md

---
v4:
* changed meson build to use tmp dir in docker build
* changed sample app dockerfile to add only helloworld source code

---
v5:
* fix whitespace error

---
v6:
* clean up temp build directory

Quoted 9 lines
---
 extras/Dockerfile.bionic | 40
+++++++++++++++++++++++++++++++++++++
 extras/README.md         | 51
++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 91 insertions(+)
 create mode 100644 extras/Dockerfile.bionic  create mode 100644

extras/README.md