-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
107 lines (96 loc) · 3.79 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# SPDX-License-Identifier: GPL-2.0
FROM ubuntu:24.10
LABEL name=mptcp-upstream-virtme-docker
# dependencies for the script
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive \
apt-get dist-upgrade -y && \
DEBIAN_FRONTEND=noninteractive \
apt-get install -y --no-install-recommends \
build-essential libncurses5-dev gcc libssl-dev bc bison byacc automake \
libelf-dev flex git curl tar hashalot qemu-kvm sudo expect \
python3 python3-pip python3-pkg-resources file virtiofsd \
busybox-static coreutils python3-requests libvirt-clients udev \
iputils-ping ethtool klibc-utils kbd rsync ccache netcat-openbsd \
ca-certificates gnupg2 net-tools kmod \
libdbus-1-dev libnl-genl-3-dev libibverbs-dev \
tcpdump \
pkg-config libmnl-dev \
clang clangd clang-tidy lld llvm llvm-dev libcap-dev \
gdb gdb-multiarch crash dwarves strace trace-cmd \
iptables ebtables nftables bridge-utils socat \
vim psmisc bash-completion less jq \
gettext-base libevent-dev libtraceevent-dev libnewt0.52 libslang2 libutempter0 python3-newt tmux gawk \
libdwarf-dev libbfd-dev libnuma-dev libzstd-dev libunwind-dev libdw-dev libslang2-dev python3-dev python3-setuptools binutils-dev libiberty-dev libbabeltrace-dev systemtap-sdt-dev libperl-dev python3-docutils \
libtap-formatter-junit-perl lcov libjson-xs-perl \
zstd \
wget xz-utils lftp cpio u-boot-tools \
cscope \
bpftrace \
golang \
mptcpize iperf3 netperf \
bmon ifstat \
&& \
apt-get clean
# byobu (not to have a dep to iproute2)
ARG BYOBU_URL="https://github.com/dustinkirkland/byobu/archive/refs/tags/6.12.tar.gz"
ARG BYOBU_SUM="abb000331858609dfda9214115705506249f69237625633c80487abe2093dd45 byobu.tar.gz"
RUN cd /opt && \
curl -L "${BYOBU_URL}" -o byobu.tar.gz && \
echo "${BYOBU_SUM}" | sha256sum -c && \
tar xzf byobu.tar.gz && \
cd byobu-*/ && \
./autogen.sh && \
./configure --prefix=/usr && \
make -j"$(nproc)" -l"$(nproc)" && \
make install
# packetdrill
ARG PACKETDRILL_GIT_URL="https://github.com/multipath-tcp/packetdrill.git"
ARG PACKETDRILL_GIT_BRANCH="mptcp-net-next"
ENV PACKETDRILL_GIT_BRANCH="${PACKETDRILL_GIT_BRANCH}"
RUN cd /opt && \
git clone "${PACKETDRILL_GIT_URL}" && \
cd packetdrill && \
git checkout "${PACKETDRILL_GIT_BRANCH}" && \
cd gtests/net/packetdrill/ && \
./configure && \
make -j"$(nproc)" -l"$(nproc)" && \
ln -s /opt/packetdrill/gtests/net/packetdrill/packetdrill \
/opt/packetdrill/gtests/net/packetdrill/run_all.py \
/usr/sbin/
# Sparse
ARG SPARSE_GIT_URL="git://git.kernel.org/pub/scm/devel/sparse/sparse.git"
ARG SPARSE_GIT_SHA="09411a7a5127516a0741eb1bd8762642fa9197ce" # include a fix for 'unreplaced' issues and llvm 16
RUN cd /opt && \
git clone "${SPARSE_GIT_URL}" sparse && \
cd "sparse" && \
git checkout "${SPARSE_GIT_SHA}" && \
make -j"$(nproc)" -l"$(nproc)" && \
make PREFIX=/usr install && \
cd .. && \
rm -rf "sparse"
# iproute
ARG IPROUTE2_GIT_URL="git://git.kernel.org/pub/scm/network/iproute2/iproute2.git"
ARG IPROUTE2_GIT_SHA="v6.12.0"
RUN cd /opt && \
git clone "${IPROUTE2_GIT_URL}" iproute2 && \
cd iproute2 && \
git checkout "${IPROUTE2_GIT_SHA}" && \
./configure && \
make -j"$(nproc)" -l"$(nproc)" && \
make install
# Virtme NG
ARG VIRTME_NG_VERSION="1.32"
RUN pip3 install --break-system-packages virtme-ng=="${VIRTME_NG_VERSION}"
# to quickly shutdown the VM and more
RUN for i in /usr/lib/klibc/bin/*; do \
type "$(basename "${i}")" >/dev/null 2>&1 || ln -sv "${i}" /usr/sbin/; \
done
# CCache for quicker builds with default colours
# Note: use 'ccache -M xG' to increase max size, default is 5GB
ENV PATH=/usr/lib/ccache:/opt/virtme-ng:${PATH}
ENV CCACHE_COMPRESS=true
ENV KBUILD_BUILD_TIMESTAMP="0"
ENV GCC_COLORS=error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01
COPY entrypoint.sh tap2json.py /
ENTRYPOINT ["/entrypoint.sh"]