forked from vmware-archive/p4c-xdp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
65 lines (55 loc) · 1.58 KB
/
Dockerfile
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
FROM ubuntu:bionic
WORKDIR /home/
ENV P4C_DEPS bison \
build-essential \
cmake \
git \
flex \
libboost-dev \
libboost-graph-dev \
libboost-iostreams-dev \
libfl-dev \
libgc-dev \
libgmp-dev \
pkg-config \
python3 \
python3-pip \
python3-setuptools
ENV P4C_EBPF_DEPS libpcap-dev \
libelf-dev \
zlib1g-dev \
llvm \
clang \
libprotobuf-dev \
protobuf-compiler \
iproute2 \
tcpdump \
iptables
ENV P4C_PIP_PACKAGES pyroute2 \
ply==3.8 \
scapy==2.4.0
RUN apt-get update
RUN apt-get install -y --no-install-recommends $P4C_DEPS
RUN apt-get install -y --no-install-recommends $P4C_EBPF_DEPS
# in some cases wheel is needed to install pip packages
RUN pip3 install wheel
RUN pip3 install $P4C_PIP_PACKAGES
# p4c download begin
RUN git clone https://github.com/p4lang/p4c.git && \
cd p4c && \
git submodule update --init --recursive && \
git submodule update --recursive && \
mkdir extensions
# p4c download end
# copy xdp into the extension folder
COPY . /home/p4c/extensions/p4c-xdp
RUN ln -s /home/p4c /home/p4c/extensions/p4c-xdp
# build p4c and p4c-xdp
RUN cd /home/p4c/ && \
python3 backends/ebpf/build_libbpf && \
mkdir -p build && \
cd build && \
cmake .. && \
make -j `getconf _NPROCESSORS_ONLN` && \
make install && \
cd ..