Skip to content

Instantly share code, notes, and snippets.

@krsna1729
Last active November 23, 2021 11:06
Show Gist options
  • Save krsna1729/8562d9f2ad8050583af9ac55ad269421 to your computer and use it in GitHub Desktop.
Save krsna1729/8562d9f2ad8050583af9ac55ad269421 to your computer and use it in GitHub Desktop.
dpdk af-xdp
FROM ubuntu as builder
RUN apt-get update && \
apt-get -y install --no-install-recommends \
ca-certificates \
git \
gcc \
libelf-dev \
libnuma-dev \
make \
pkg-config \
python3-pip \
python3-setuptools && \
rm -rf /var/lib/apt/lists/*
RUN pip3 install --no-cache-dir \
meson \
ninja \
pyelftools
# Download all code
RUN git clone https://github.com/libbpf/libbpf.git /libbpf && \
git clone https://dpdk.org/git/dpdk /dpdk
ENV PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig
# Compile all code
ARG LIBBPF_VER=v0.5.0
RUN cd /libbpf && \
git checkout -b build ${LIBBPF_VER} && \
cp include/uapi/linux/if_xdp.h /usr/include/linux && \
cd src && \
LIBDIR=/usr/lib/x86_64-linux-gnu make install && \
ldconfig
ARG DPDK_VER=v21.11-rc3
RUN cd /dpdk && \
git checkout -b build ${DPDK_VER} && \
meson build && \
ninja -C build
ENV PATH=${PATH}:/dpdk/build/app
# FROM ubuntu
# RUN apt-get update && \
# apt-get -y install --no-install-recommends \
# iproute2 \
# libatomic1 \
# libnuma1
# COPY --from=builder /dpdk/build/app/dpdk-testpmd /bin
@krsna1729
Copy link
Author

$ docker run test ldd /dpdk/build/app/dpdk-testpmd
        linux-vdso.so.1 (0x00007fffd0155000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f52d0f81000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f52d0f7b000)
        libelf.so.1 => /lib/x86_64-linux-gnu/libelf.so.1 (0x00007f52d0f5f000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f52d0f43000)
        libatomic.so.1 => /lib/x86_64-linux-gnu/libatomic.so.1 (0x00007f52d0f39000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f52d0f16000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f52d0d22000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f52d2ff6000)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment