[v2] build: add dockerfile for building docker image

Message ID 1570183701-407946-1-git-send-email-abdul.halim@intel.com (mailing list archive)
State Superseded, archived
Delegated to: David Marchand
Headers
Series [v2] build: add dockerfile for building docker image |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-compilation success Compile Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS

Commit Message

Abdul Halim Oct. 4, 2019, 10:08 a.m. UTC
  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.

Signed-off-by: Abdul Halim <abdul.halim@intel.com>

---

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
  

Comments

Ray Kinsella Oct. 15, 2019, 8:39 a.m. UTC | #1
On 04/10/2019 11:08, Abdul Halim wrote:
> 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.
> 
> Signed-off-by: Abdul Halim <abdul.halim@intel.com>
> 
> ---
> 
> 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
> 
> diff --git a/extras/Dockerfile.bionic b/extras/Dockerfile.bionic
> new file mode 100644
> index 0000000..f83b720
> --- /dev/null
> +++ b/extras/Dockerfile.bionic
> @@ -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
> diff --git a/extras/README.md b/extras/README.md
> new file mode 100644
> index 0000000..f1aa898
> --- /dev/null
> +++ b/extras/README.md
> @@ -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 .
> +```
> 
Acked-by: Ray Kinsella <mdr@ashroe.eu>
  
Yasufumi Ogawa Nov. 13, 2019, 8:26 p.m. UTC | #2
On 2019/10/15 1:39, Ray Kinsella wrote:
> 
> 
> On 04/10/2019 11:08, Abdul Halim wrote:
>> 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

>>
>> Signed-off-by: Abdul Halim <abdul.halim@intel.com>
>>
>> ---
>>
>> 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
>>
>> diff --git a/extras/Dockerfile.bionic b/extras/Dockerfile.bionic
>> new file mode 100644
>> index 0000000..f83b720
>> --- /dev/null
>> +++ b/extras/Dockerfile.bionic
>> @@ -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
>> diff --git a/extras/README.md b/extras/README.md
>> new file mode 100644
>> index 0000000..f1aa898
>> --- /dev/null
>> +++ b/extras/README.md
>> @@ -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 .
>> +```
>>
> Acked-by: Ray Kinsella <mdr@ashroe.eu>
> 
Tested-by: Yasufumi Ogawa <yasufum.o@gmail.com>
  

Patch

diff --git a/extras/Dockerfile.bionic b/extras/Dockerfile.bionic
new file mode 100644
index 0000000..f83b720
--- /dev/null
+++ b/extras/Dockerfile.bionic
@@ -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
diff --git a/extras/README.md b/extras/README.md
new file mode 100644
index 0000000..f1aa898
--- /dev/null
+++ b/extras/README.md
@@ -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 .
+```