All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ruifeng Wang (Arm Technology China)" <Ruifeng.Wang@arm.com>
To: Abdul Halim <abdul.halim@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "ray.kinsella@intel.com" <ray.kinsella@intel.com>,
	"yasufum.o@gmail.com" <yasufum.o@gmail.com>, nd <nd@arm.com>
Subject: Re: [dpdk-dev] [PATCH v5] build: add dockerfile for building docker image
Date: Wed, 11 Dec 2019 06:45:22 +0000	[thread overview]
Message-ID: <AM0PR08MB3986810CEA2A08CE1A58CD7B9E5A0@AM0PR08MB3986.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <1575986121-366042-1-git-send-email-abdul.halim@intel.com>


> -----Original Message-----
> From: Abdul Halim <abdul.halim@intel.com>
> Sent: Tuesday, December 10, 2019 21:55
> To: dev@dpdk.org
> Cc: ray.kinsella@intel.com; yasufum.o@gmail.com; Ruifeng Wang (Arm
> Technology China) <Ruifeng.Wang@arm.com>; Abdul Halim
> <abdul.halim@intel.com>
> 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.
> 
> 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
> 
> ---
> 
> 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
> 
> diff --git a/extras/Dockerfile.bionic b/extras/Dockerfile.bionic new file mode
> 100644 index 0000000..cf9c176
> --- /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 /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
> +
> +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..8001012
> --- /dev/null
> +++ b/extras/README.md
> @@ -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.
> +
> +```
> +$ 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.


  parent reply	other threads:[~2019-12-11  6:45 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-27 16:44 [dpdk-dev] [PATCH] build: add dockerfile for building docker image Abdul Halim
2019-09-30  8:54 ` Ray Kinsella
2019-09-30 12:21   ` Halim, Abdul
2019-10-04 10:08 ` [dpdk-dev] [PATCH v2] " Abdul Halim
2019-10-15  8:39   ` Ray Kinsella
2019-11-13 20:26     ` Yasufumi Ogawa
2019-12-03 11:42 ` [dpdk-dev] [PATCH v3] " Abdul Halim
2019-12-05 14:13   ` Ruifeng Wang (Arm Technology China)
2019-12-05 19:51     ` Yasufumi Ogawa
2019-12-06 11:12       ` Halim, Abdul
2019-12-09  3:23         ` Ruifeng Wang (Arm Technology China)
2019-12-09  9:44           ` Yasufumi Ogawa
2019-12-09 10:18         ` Yasufumi Ogawa
2019-12-10 13:16           ` Halim, Abdul
2019-12-10 13:44 ` [dpdk-dev] [PATCH v4] " Abdul Halim
2019-12-10 13:55 ` [dpdk-dev] [PATCH v5] " Abdul Halim
2019-12-10 17:44   ` Ray Kinsella
2019-12-11 10:53     ` Halim, Abdul
2019-12-11 17:00       ` Ray Kinsella
2023-06-12  2:44         ` Stephen Hemminger
2019-12-11  6:45   ` Ruifeng Wang (Arm Technology China) [this message]
2019-12-11 16:35     ` Halim, Abdul
2019-12-11 16:39 ` [dpdk-dev] [PATCH v6] " Abdul Halim
2019-12-12  6:53   ` Ruifeng Wang (Arm Technology China)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM0PR08MB3986810CEA2A08CE1A58CD7B9E5A0@AM0PR08MB3986.eurprd08.prod.outlook.com \
    --to=ruifeng.wang@arm.com \
    --cc=abdul.halim@intel.com \
    --cc=dev@dpdk.org \
    --cc=nd@arm.com \
    --cc=ray.kinsella@intel.com \
    --cc=yasufum.o@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.