2022-03-17 23:01:52 -05:00
|
|
|
{% set prefix = DEFAULT_CONTAINER_REGISTRY %}
|
2021-04-18 10:17:57 -05:00
|
|
|
{% if CONFIGURED_ARCH == "armhf" and MULTIARCH_QEMU_ENVIRON == "y" %}
|
2022-03-17 23:01:52 -05:00
|
|
|
FROM {{ prefix }}multiarch/debian-debootstrap:armhf-stretch
|
2021-04-18 10:17:57 -05:00
|
|
|
{% elif CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %}
|
2022-03-17 23:01:52 -05:00
|
|
|
FROM {{ prefix }}multiarch/debian-debootstrap:arm64-stretch
|
2019-07-26 00:06:41 -05:00
|
|
|
{% else %}
|
2022-03-17 23:01:52 -05:00
|
|
|
FROM {{ prefix }}debian:stretch
|
2019-07-26 00:06:41 -05:00
|
|
|
{% endif %}
|
2016-08-04 12:39:33 -05:00
|
|
|
|
|
|
|
MAINTAINER Pavel Shirshov
|
|
|
|
|
2019-03-27 01:46:39 -05:00
|
|
|
## Remove retired jessie-updates repo
|
|
|
|
RUN sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list
|
|
|
|
|
2016-08-04 12:39:33 -05:00
|
|
|
## Copy dependencies
|
2017-01-19 14:19:21 -06:00
|
|
|
COPY \
|
|
|
|
{% for deb in docker_ptf_debs.split(' ') -%}
|
|
|
|
debs/{{ deb }}{{' '}}
|
|
|
|
{%- endfor -%}
|
|
|
|
debs/
|
2016-08-04 12:39:33 -05:00
|
|
|
|
|
|
|
## Make apt-get non-interactive
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
|
|
|
## Set the apt source, update package cache and install necessary packages
|
2020-04-13 18:56:19 -05:00
|
|
|
## TODO: Clean up this step
|
2016-09-09 19:53:41 -05:00
|
|
|
RUN sed --in-place 's/httpredir.debian.org/debian-archive.trafficmanager.net/' /etc/apt/sources.list \
|
|
|
|
&& apt-get update \
|
|
|
|
&& apt-get upgrade -y \
|
2016-08-04 12:39:33 -05:00
|
|
|
&& apt-get dist-upgrade -y \
|
2016-09-09 19:53:41 -05:00
|
|
|
&& apt-get install -y \
|
2020-01-23 11:28:39 -06:00
|
|
|
autoconf \
|
2016-08-04 12:39:33 -05:00
|
|
|
openssh-server \
|
|
|
|
vim \
|
2019-11-25 11:00:47 -06:00
|
|
|
telnet \
|
2016-08-04 12:39:33 -05:00
|
|
|
net-tools \
|
|
|
|
traceroute \
|
|
|
|
lsof \
|
|
|
|
tcpdump \
|
2019-11-25 11:00:47 -06:00
|
|
|
ethtool \
|
2016-08-04 12:39:33 -05:00
|
|
|
unzip \
|
|
|
|
pkg-config \
|
|
|
|
binutils \
|
|
|
|
build-essential \
|
|
|
|
libssl-dev \
|
|
|
|
libffi-dev \
|
|
|
|
wget \
|
|
|
|
cmake \
|
2016-12-09 04:24:08 -06:00
|
|
|
libqt5core5a \
|
2017-05-01 20:47:29 -05:00
|
|
|
libqt5network5 \
|
2019-05-29 20:26:52 -05:00
|
|
|
libboost-atomic1.62.0 \
|
2017-05-24 03:34:37 -05:00
|
|
|
less \
|
2017-05-26 20:32:52 -05:00
|
|
|
git \
|
2017-05-31 12:49:31 -05:00
|
|
|
iputils-ping \
|
2017-06-16 09:25:40 -05:00
|
|
|
hping3 \
|
2017-07-06 04:27:05 -05:00
|
|
|
curl \
|
2019-11-20 09:39:49 -06:00
|
|
|
tmux \
|
2017-07-06 04:27:05 -05:00
|
|
|
python \
|
|
|
|
python-dev \
|
2019-11-09 00:57:05 -06:00
|
|
|
python-libpcap \
|
2019-03-12 23:38:25 -05:00
|
|
|
python-scapy \
|
2020-03-05 03:37:23 -06:00
|
|
|
python-six \
|
|
|
|
tacacs+ \
|
2020-03-18 13:01:36 -05:00
|
|
|
rsyslog \
|
|
|
|
ntp \
|
|
|
|
ntpstat \
|
2020-04-13 18:56:19 -05:00
|
|
|
ntpdate \
|
|
|
|
arping \
|
|
|
|
bridge-utils
|
2016-12-09 04:24:08 -06:00
|
|
|
|
|
|
|
RUN dpkg -i \
|
|
|
|
{% for deb in docker_ptf_debs.split(' ') -%}
|
|
|
|
debs/{{ deb }}{{' '}}
|
|
|
|
{%- endfor %}
|
|
|
|
|
2017-07-06 04:27:05 -05:00
|
|
|
# Install all python modules from pypi. python-scapy is exception, ptf debian package requires python-scapy
|
2020-04-13 18:56:19 -05:00
|
|
|
# TODO: Clean up this step
|
2016-12-09 04:24:08 -06:00
|
|
|
RUN rm -rf /debs \
|
2016-08-04 12:39:33 -05:00
|
|
|
&& apt-get -y autoclean \
|
|
|
|
&& apt-get -y autoremove \
|
|
|
|
&& rm -rf /var/lib/apt/lists/* \
|
2021-03-09 20:15:16 -06:00
|
|
|
&& wget --https-only https://bootstrap.pypa.io/pip/2.7/get-pip.py \
|
2017-07-06 04:27:05 -05:00
|
|
|
&& python get-pip.py \
|
|
|
|
&& rm -f get-pip.py \
|
|
|
|
&& pip install setuptools \
|
|
|
|
&& pip install supervisor \
|
|
|
|
&& pip install ipython==5.4.1 \
|
|
|
|
&& git clone https://github.com/p4lang/scapy-vxlan.git \
|
|
|
|
&& cd scapy-vxlan \
|
|
|
|
&& python setup.py install \
|
|
|
|
&& cd .. \
|
|
|
|
&& rm -fr scapy-vxlan \
|
2020-01-23 11:28:39 -06:00
|
|
|
&& git clone https://github.com/sflow/sflowtool \
|
|
|
|
&& cd sflowtool \
|
|
|
|
&& ./boot.sh \
|
|
|
|
&& ./configure \
|
|
|
|
&& make \
|
|
|
|
&& make install \
|
|
|
|
&& cd .. \
|
|
|
|
&& rm -fr sflowtool \
|
2021-12-14 13:46:48 -06:00
|
|
|
&& git clone https://github.com/dyninc/OpenBFDD.git \
|
|
|
|
&& cd OpenBFDD \
|
|
|
|
&& ./autogen.sh \
|
|
|
|
&& ./configure \
|
|
|
|
&& make \
|
|
|
|
&& make install \
|
|
|
|
&& cd .. \
|
|
|
|
&& rm -fr OpenBFDD \
|
2016-08-04 12:39:33 -05:00
|
|
|
&& wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \
|
|
|
|
&& tar xvfz 1.0.0.tar.gz \
|
|
|
|
&& cd nanomsg-1.0.0 \
|
|
|
|
&& mkdir -p build \
|
2016-09-09 19:53:41 -05:00
|
|
|
&& cd build \
|
|
|
|
&& cmake .. \
|
2016-08-04 12:39:33 -05:00
|
|
|
&& make install \
|
|
|
|
&& ldconfig \
|
2016-09-09 19:53:41 -05:00
|
|
|
&& cd ../.. \
|
2016-08-04 12:39:33 -05:00
|
|
|
&& rm -fr nanomsg-1.0.0 \
|
|
|
|
&& rm -f 1.0.0.tar.gz \
|
2017-07-06 04:27:05 -05:00
|
|
|
&& pip install cffi \
|
2016-08-04 12:39:33 -05:00
|
|
|
&& pip install nnpy \
|
2017-01-25 20:19:15 -06:00
|
|
|
&& pip install dpkt \
|
2017-02-01 14:49:43 -06:00
|
|
|
&& pip install ipaddress \
|
2017-04-29 02:15:12 -05:00
|
|
|
&& pip install pysubnettree \
|
2017-05-24 03:34:37 -05:00
|
|
|
&& pip install paramiko \
|
2017-06-16 09:25:40 -05:00
|
|
|
&& pip install flask \
|
|
|
|
&& pip install exabgp==3.4.17\
|
2017-07-20 01:21:03 -05:00
|
|
|
&& pip install pyaml \
|
2020-04-13 18:56:19 -05:00
|
|
|
&& pip install pybrctl pyro4 rpyc yabgp \
|
2021-08-11 22:55:21 -05:00
|
|
|
&& pip install unittest-xml-reporting \
|
2016-08-04 12:39:33 -05:00
|
|
|
&& mkdir -p /opt \
|
|
|
|
&& cd /opt \
|
|
|
|
&& wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py
|
|
|
|
|
|
|
|
## Adjust sshd settings
|
|
|
|
RUN mkdir /var/run/sshd \
|
2019-07-23 09:02:31 -05:00
|
|
|
&& echo 'root:root' | chpasswd \
|
|
|
|
&& sed -ri '/^#?PermitRootLogin/c\PermitRootLogin yes' /etc/ssh/sshd_config \
|
|
|
|
&& sed -ri '/^#?UsePAM/c\UsePAM no' /etc/ssh/sshd_config \
|
|
|
|
&& sed -ri '/^#?UseDNS/c\UseDNS no' /etc/ssh/sshd_config
|
2016-08-04 12:39:33 -05:00
|
|
|
|
2020-04-13 18:56:19 -05:00
|
|
|
COPY supervisord.conf /etc/supervisor/
|
|
|
|
COPY conf.d/ /etc/supervisor/conf.d/
|
|
|
|
COPY ptf_tgen.sh /ptf_tgen/
|
2017-07-24 15:36:40 -05:00
|
|
|
|
2017-11-29 18:36:26 -06:00
|
|
|
# Move tcpdump into /usr/bin Otherwise it's impossible to run tcpdump due to a docker bug
|
|
|
|
RUN mv /usr/sbin/tcpdump /usr/bin/tcpdump
|
|
|
|
RUN ln -s /usr/bin/tcpdump /usr/sbin/tcpdump
|
|
|
|
|
2017-07-24 15:36:40 -05:00
|
|
|
RUN mkdir -p /var/log/supervisor
|
2016-08-04 12:39:33 -05:00
|
|
|
|
2020-07-10 21:58:47 -05:00
|
|
|
# Install Python-based GNMI client
|
|
|
|
RUN git clone https://github.com/lguohan/gnxi.git \
|
|
|
|
&& cd gnxi \
|
2020-12-18 00:12:04 -06:00
|
|
|
&& git checkout 53901ab \
|
2020-07-10 21:58:47 -05:00
|
|
|
&& cd gnmi_cli_py \
|
|
|
|
&& pip install -r requirements.txt
|
|
|
|
|
2021-01-23 03:27:20 -06:00
|
|
|
COPY \
|
|
|
|
{% for deb in docker_ptf_debs.split(' ') -%}
|
|
|
|
debs/{{ deb }}{{' '}}
|
|
|
|
{%- endfor -%}
|
|
|
|
debs/
|
|
|
|
|
|
|
|
RUN dpkg -i \
|
|
|
|
{% for deb in docker_ptf_debs.split(' ') -%}
|
|
|
|
debs/{{ deb }}{{' '}}
|
|
|
|
{%- endfor %}
|
|
|
|
|
|
|
|
COPY ["*.ini", "/etc/ptf/"]
|
2020-04-13 18:56:19 -05:00
|
|
|
EXPOSE 22 8009
|
2016-08-04 12:39:33 -05:00
|
|
|
|
2017-07-24 15:36:40 -05:00
|
|
|
ENTRYPOINT ["/usr/local/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
|