2019-07-26 00:06:41 -05:00
|
|
|
{% if CONFIGURED_ARCH == "armhf" %}
|
|
|
|
FROM multiarch/debian-debootstrap:armhf-stretch
|
|
|
|
{% elif CONFIGURED_ARCH == "arm64" %}
|
|
|
|
FROM multiarch/debian-debootstrap:arm64-stretch
|
|
|
|
{% else %}
|
2019-05-29 20:26:52 -05:00
|
|
|
FROM 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
|
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 \
|
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 \
|
|
|
|
net-tools \
|
|
|
|
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 \
|
2017-10-20 07:09:37 -05:00
|
|
|
tcpdump \
|
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+ \
|
|
|
|
rsyslog
|
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
|
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/* \
|
2017-07-06 04:27:05 -05:00
|
|
|
&& wget --https-only https://bootstrap.pypa.io/get-pip.py \
|
|
|
|
&& 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 \
|
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 \
|
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
|
|
|
|
2017-07-24 15:36:40 -05:00
|
|
|
COPY ["supervisord.conf", "/etc/supervisor/"]
|
|
|
|
COPY ["conf.d/supervisord.conf", "conf.d/sshd.conf", "conf.d/ptf_nn_agent.conf", "/etc/supervisor/conf.d/"]
|
|
|
|
|
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
|
|
|
|
|
|
|
EXPOSE 22
|
|
|
|
|
2017-07-24 15:36:40 -05:00
|
|
|
ENTRYPOINT ["/usr/local/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
|