blob: f7e19feebbf7915667aa1371e9fe3a0809800777 [file] [log] [blame]
Matthew Giassa4a0dd382021-11-19 17:06:11 +00001#------------------------------------------------------------------------------#
2# @brief: Dockerfile for building the VPP testbench project.
3# @author: Matthew Giassa <mgiassa@cisco.com>
4# @copyright: (C) Cisco 2021.
5#------------------------------------------------------------------------------#
6# Baseline image both client and server inherit from.
7FROM ubuntu:focal as baseline
8
9# System packages.
10RUN apt update -y && \
11 DEBIAN_FRONTEND="noninteractive" apt install -y tzdata termshark && \
12 apt install -y \
13 apt-transport-https \
14 axel \
15 bash \
16 binutils \
17 bridge-utils \
18 ca-certificates \
19 coreutils \
20 curl \
21 gnupg \
22 htop \
23 iftop \
24 iproute2 \
25 iptables \
26 iputils-ping \
27 netcat \
28 net-tools \
29 nload \
30 nmap \
31 procps \
32 python3 \
33 python3-dev \
34 python3-pip \
35 sudo \
36 wget \
37 tcpdump \
38 vim \
39 && \
40 apt clean -y
41# Python packages.
42RUN python3 -m pip install \
43 scapy
44
45# VPP.
46RUN bash -c "curl -L https://packagecloud.io/fdio/master/gpgkey | apt-key add -" && \
47 bash -c "echo \"deb [trusted=yes] https://packagecloud.io/fdio/release/ubuntu focal main\" >> /etc/apt/sources.list.d/99fd.io.list" && \
48 apt update && \
49 apt install -y \
50 vpp \
51 vpp-plugin-core \
52 vpp-plugin-dpdk \
53 && \
54 apt clean -y
55
56# Used by client/server entrypoint scripts.
57ADD vpp_testbench_helpers.sh /
58
59
60#------------------------------------------------------------------------------#
61# Client image.
62FROM baseline as client_img
63# Enable a health probe.
64ARG HEALTHCHECK_PORT=8080
65ENV HEALTHCHECK_PORT_RUNTIME="${HEALTHCHECK_PORT}"
66HEALTHCHECK CMD curl --fail "http://localhost:$HEALTHCHECK_PORT_RUNTIME" || exit 1
67# Image-specific overrides.
68ADD ./entrypoint_client.sh /entrypoint.sh
69ENTRYPOINT ["/entrypoint.sh"]
70
71
72#------------------------------------------------------------------------------#
73# Server image.
74FROM baseline as server_img
75# Enable a health probe.
76ARG HEALTHCHECK_PORT=8080
77ENV HEALTHCHECK_PORT_RUNTIME="${HEALTHCHECK_PORT}"
78HEALTHCHECK CMD curl --fail "http://localhost:$HEALTHCHECK_PORT_RUNTIME" || exit 1
79# Image-specific overrides.
80ADD ./entrypoint_server.sh /entrypoint.sh
81ENTRYPOINT ["/entrypoint.sh"]
82