You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to deploy a BCC program with Docker. I am using hello_world.py as a reference but I am getting the following error:
bpf: Argument list too long. Program too large (0 insns), at most 4096 insns
Traceback (most recent call last):
File "./main.py", line 2, in <module>
BPF(text='int kprobe__sys_clone(void *ctx) { bpf_trace_printk("Hello, World!\\n"); return 0; }').trace_print()
File "/usr/lib/python3/dist-packages/bcc-0.31.0+7988a53e-py3.8.egg/bcc/__init__.py", line 488, in __init__
File "/usr/lib/python3/dist-packages/bcc-0.31.0+7988a53e-py3.8.egg/bcc/__init__.py", line 1480, in _trace_autoload
File "/usr/lib/python3/dist-packages/bcc-0.31.0+7988a53e-py3.8.egg/bcc/__init__.py", line 527, in load_func
Exception: Failed to load BPF program b'kprobe__sys_clone': Argument list too long
Current setup:
Ubuntu 20.04
AMD x64
BCC v0.31.0-1-g7988a53e
Kernel version 5.15
The BCC Python script and Dockerfile are as follows:
# Dockerfile
FROM alpine:3.8
RUN apk add --update \
bash \
bc \
build-base \
bison \
flex \
curl \
elfutils-dev \
linux-headers \
make \
openssl-dev \
zip
WORKDIR /
COPY /init/fetch-linux-headers.sh /
RUN chmod +x fetch-linux-headers.sh
ENTRYPOINT [ "/fetch-linux-headers.sh" ]
FROM ubuntu:20.04 as build
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt install -y zip bison python3-pip build-essential cmake flex git libedit-dev \
libllvm7 llvm-7-dev libclang-7-dev python zlib1g-dev libelf-dev libfl-dev bpfcc-tools \
python3-setuptools \
linux-headers-$(uname -r) \
liblzma-dev arping netperf iperf
RUN git clone https://github.com/iovisor/bcc.git
RUN mkdir bcc/build
WORKDIR bcc/build
RUN cmake ..
RUN make
RUN make install
RUN cmake -DPYTHON_CMD=python3 ..
RUN rm -rf /usr/lib/python3/dist-packages/bcc
WORKDIR /usr/sbin/
COPY main.py .
CMD ["python3", "./main.py"]
The Python script runs correctly when executed via the command line, but it gets an E2BIG error when running via Docker.
I am using the following docker command to run the image: sudo docker run -it --privileged <image>
Is there any additional configuration on the Dockerfile or flag in the Docker command that I might be missing?
The text was updated successfully, but these errors were encountered:
Hello!
I am trying to deploy a BCC program with Docker. I am using hello_world.py as a reference but I am getting the following error:
Current setup:
Ubuntu 20.04
AMD x64
BCC v0.31.0-1-g7988a53e
Kernel version 5.15
The BCC Python script and Dockerfile are as follows:
The Python script runs correctly when executed via the command line, but it gets an E2BIG error when running via Docker.
I am using the following docker command to run the image:
sudo docker run -it --privileged <image>
Is there any additional configuration on the Dockerfile or flag in the Docker command that I might be missing?
The text was updated successfully, but these errors were encountered: