blob: f7e19feebbf7915667aa1371e9fe3a0809800777 (
plain)
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
|
#------------------------------------------------------------------------------#
# @brief: Dockerfile for building the VPP testbench project.
# @author: Matthew Giassa <mgiassa@cisco.com>
# @copyright: (C) Cisco 2021.
#------------------------------------------------------------------------------#
# Baseline image both client and server inherit from.
FROM ubuntu:focal as baseline
# System packages.
RUN apt update -y && \
DEBIAN_FRONTEND="noninteractive" apt install -y tzdata termshark && \
apt install -y \
apt-transport-https \
axel \
bash \
binutils \
bridge-utils \
ca-certificates \
coreutils \
curl \
gnupg \
htop \
iftop \
iproute2 \
iptables \
iputils-ping \
netcat \
net-tools \
nload \
nmap \
procps \
python3 \
python3-dev \
python3-pip \
sudo \
wget \
tcpdump \
vim \
&& \
apt clean -y
# Python packages.
RUN python3 -m pip install \
scapy
# VPP.
RUN bash -c "curl -L https://packagecloud.io/fdio/master/gpgkey | apt-key add -" && \
bash -c "echo \"deb [trusted=yes] https://packagecloud.io/fdio/release/ubuntu focal main\" >> /etc/apt/sources.list.d/99fd.io.list" && \
apt update && \
apt install -y \
vpp \
vpp-plugin-core \
vpp-plugin-dpdk \
&& \
apt clean -y
# Used by client/server entrypoint scripts.
ADD vpp_testbench_helpers.sh /
#------------------------------------------------------------------------------#
# Client image.
FROM baseline as client_img
# Enable a health probe.
ARG HEALTHCHECK_PORT=8080
ENV HEALTHCHECK_PORT_RUNTIME="${HEALTHCHECK_PORT}"
HEALTHCHECK CMD curl --fail "http://localhost:$HEALTHCHECK_PORT_RUNTIME" || exit 1
# Image-specific overrides.
ADD ./entrypoint_client.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
#------------------------------------------------------------------------------#
# Server image.
FROM baseline as server_img
# Enable a health probe.
ARG HEALTHCHECK_PORT=8080
ENV HEALTHCHECK_PORT_RUNTIME="${HEALTHCHECK_PORT}"
HEALTHCHECK CMD curl --fail "http://localhost:$HEALTHCHECK_PORT_RUNTIME" || exit 1
# Image-specific overrides.
ADD ./entrypoint_server.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
|