-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (20 loc) · 799 Bytes
/
Dockerfile
File metadata and controls
30 lines (20 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
ARG PROGRAM_NAME="xdp-udp"
FROM ubuntu:20.04 AS build
ARG PROGRAM_NAME
RUN export DEBIAN_FRONTEND=noninteractive && apt-get update \
&& apt-get install -y clang llvm libbpf-dev
COPY *.c /
RUN find /usr -name types.h
RUN echo ${PROGRAM_NAME}
RUN clang -g -c -O2 -target bpf -I/usr/include/x86_64-linux-gnu/ -c ${PROGRAM_NAME}.c -o ${PROGRAM_NAME}.o \
&& objdump -t ${PROGRAM_NAME}.o && llvm-objdump -S ${PROGRAM_NAME}.o
FROM ubuntu:20.04 AS image
ARG PROGRAM_NAME
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update && apt-get install -y iproute2 iputils-ping netcat python3 libbpf-dev vim ethtool linux-tools-common
COPY --from=build /${PROGRAM_NAME}.o /
COPY /entrypoint.sh /
COPY ./start-udp-server.sh /
COPY ./udpserver.py /
COPY ./udp-send-msg.py /
ENTRYPOINT ["bash"]