2017-10-25 21:29:21 +02:00
|
|
|
# Usage:
|
|
|
|
# docker run --rm -it \
|
|
|
|
# --privileged \
|
|
|
|
# -v /lib/modules:/lib/modules:ro \
|
|
|
|
# -v /usr/src:/usr/src:ro \
|
|
|
|
# -v /etc/localtime:/etc/localtime:ro \
|
|
|
|
# r.j3ss.co/bcc-tools
|
|
|
|
#
|
2019-09-16 23:00:18 +02:00
|
|
|
FROM debian:sid-slim
|
2018-09-14 16:13:32 +02:00
|
|
|
MAINTAINER Jessica Frazelle <jess@linux.com>
|
2017-10-25 21:29:21 +02:00
|
|
|
|
2018-09-14 16:18:41 +02:00
|
|
|
ENV PATH /usr/share/bcc/tools:$PATH
|
2018-09-14 16:13:32 +02:00
|
|
|
|
|
|
|
# Add non-free apt sources
|
|
|
|
RUN sed -i "s#deb http://deb.debian.org/debian buster main#deb http://deb.debian.org/debian buster main contrib non-free#g" /etc/apt/sources.list
|
2017-10-25 21:29:21 +02:00
|
|
|
|
2018-09-14 16:13:32 +02:00
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
|
ca-certificates \
|
|
|
|
clang \
|
|
|
|
curl \
|
|
|
|
gcc \
|
|
|
|
git \
|
|
|
|
g++ \
|
|
|
|
--no-install-recommends \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
2017-10-25 21:29:21 +02:00
|
|
|
|
2018-09-14 16:13:32 +02:00
|
|
|
# Install dependencies for libbcc
|
|
|
|
# FROM: https://github.com/iovisor/bcc/blob/master/INSTALL.md#install-build-dependencies
|
2017-10-25 21:29:21 +02:00
|
|
|
RUN apt-get update && apt-get install -y \
|
2018-09-14 16:13:32 +02:00
|
|
|
debhelper \
|
|
|
|
cmake \
|
|
|
|
libllvm3.9 \
|
|
|
|
llvm-dev \
|
|
|
|
libclang-dev \
|
|
|
|
libelf-dev \
|
|
|
|
bison \
|
|
|
|
flex \
|
|
|
|
libedit-dev \
|
|
|
|
clang-format \
|
|
|
|
python \
|
|
|
|
python-netaddr \
|
2019-12-06 02:29:13 +01:00
|
|
|
python3-pyroute2 \
|
2018-09-14 16:13:32 +02:00
|
|
|
luajit \
|
|
|
|
libluajit-5.1-dev \
|
|
|
|
arping \
|
|
|
|
iperf \
|
|
|
|
ethtool \
|
|
|
|
devscripts \
|
|
|
|
zlib1g-dev \
|
|
|
|
libfl-dev \
|
|
|
|
--no-install-recommends \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
# Build libbcc
|
2020-05-15 08:13:42 +02:00
|
|
|
ENV BCC_VERSION v0.14.0
|
2018-09-17 21:42:01 +02:00
|
|
|
RUN git clone --depth 1 --branch "$BCC_VERSION" https://github.com/iovisor/bcc.git /usr/src/bcc \
|
|
|
|
&& ( \
|
2018-09-14 16:18:41 +02:00
|
|
|
cd /usr/src/bcc \
|
|
|
|
&& mkdir build \
|
|
|
|
&& cd build \
|
|
|
|
&& cmake .. -DCMAKE_INSTALL_PREFIX=/usr \
|
2018-09-14 16:13:32 +02:00
|
|
|
&& make \
|
|
|
|
&& make install \
|
|
|
|
) \
|
2018-09-14 16:18:41 +02:00
|
|
|
&& rm -rf /usr/src/bcc
|
2017-10-25 21:29:21 +02:00
|
|
|
|
|
|
|
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
|
|
|
|
|
|
|
ENTRYPOINT ["entrypoint.sh"]
|