Matthew Giassa | 4a0dd38 | 2021-11-19 17:06:11 +0000 | [diff] [blame] | 1 | #------------------------------------------------------------------------------# |
| 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. |
| 7 | FROM ubuntu:focal as baseline |
| 8 | |
| 9 | # System packages. |
| 10 | RUN 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. |
| 42 | RUN python3 -m pip install \ |
| 43 | scapy |
| 44 | |
| 45 | # VPP. |
| 46 | RUN 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. |
| 57 | ADD vpp_testbench_helpers.sh / |
| 58 | |
| 59 | |
| 60 | #------------------------------------------------------------------------------# |
| 61 | # Client image. |
| 62 | FROM baseline as client_img |
| 63 | # Enable a health probe. |
| 64 | ARG HEALTHCHECK_PORT=8080 |
| 65 | ENV HEALTHCHECK_PORT_RUNTIME="${HEALTHCHECK_PORT}" |
| 66 | HEALTHCHECK CMD curl --fail "http://localhost:$HEALTHCHECK_PORT_RUNTIME" || exit 1 |
| 67 | # Image-specific overrides. |
| 68 | ADD ./entrypoint_client.sh /entrypoint.sh |
| 69 | ENTRYPOINT ["/entrypoint.sh"] |
| 70 | |
| 71 | |
| 72 | #------------------------------------------------------------------------------# |
| 73 | # Server image. |
| 74 | FROM baseline as server_img |
| 75 | # Enable a health probe. |
| 76 | ARG HEALTHCHECK_PORT=8080 |
| 77 | ENV HEALTHCHECK_PORT_RUNTIME="${HEALTHCHECK_PORT}" |
| 78 | HEALTHCHECK CMD curl --fail "http://localhost:$HEALTHCHECK_PORT_RUNTIME" || exit 1 |
| 79 | # Image-specific overrides. |
| 80 | ADD ./entrypoint_server.sh /entrypoint.sh |
| 81 | ENTRYPOINT ["/entrypoint.sh"] |
| 82 | |