2016-08-04 12:39:33 -05:00
|
|
|
FROM debian:jessie
|
|
|
|
|
|
|
|
MAINTAINER Pavel Shirshov
|
|
|
|
|
|
|
|
## 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 \
|
|
|
|
python \
|
|
|
|
python-scapy \
|
|
|
|
net-tools \
|
|
|
|
python-setuptools \
|
|
|
|
supervisor \
|
|
|
|
traceroute \
|
|
|
|
lsof \
|
|
|
|
tcpdump \
|
|
|
|
unzip \
|
|
|
|
pkg-config \
|
|
|
|
binutils \
|
|
|
|
net-tools \
|
|
|
|
python-pip \
|
|
|
|
build-essential \
|
|
|
|
libssl-dev \
|
|
|
|
libffi-dev \
|
|
|
|
python-dev \
|
|
|
|
wget \
|
|
|
|
cmake \
|
2016-12-09 04:24:08 -06:00
|
|
|
libqt5core5a \
|
2017-05-01 20:47:29 -05:00
|
|
|
libqt5network5 \
|
|
|
|
iputils-ping
|
|
|
|
|
2016-12-09 04:24:08 -06:00
|
|
|
|
|
|
|
RUN dpkg -i \
|
|
|
|
{% for deb in docker_ptf_debs.split(' ') -%}
|
|
|
|
debs/{{ deb }}{{' '}}
|
|
|
|
{%- endfor %}
|
|
|
|
|
|
|
|
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/* \
|
|
|
|
&& 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 \
|
2016-09-09 19:53:41 -05:00
|
|
|
&& pip install cffi==1.7.0 \
|
|
|
|
&& pip install --upgrade cffi==1.7.0 \
|
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 \
|
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 \
|
|
|
|
&& echo 'root:root' | chpasswd \
|
|
|
|
&& sed -ri 's/^PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config \
|
|
|
|
&& sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config \
|
|
|
|
&& sed -i '$aUseDNS no' /etc/ssh/sshd_config \
|
|
|
|
&& mkdir /root/deps
|
|
|
|
|
2017-05-08 17:43:31 -05:00
|
|
|
COPY ["supervisord.conf", "sshd.conf", "ptf_nn_agent.conf", "/etc/supervisor/conf.d/"]
|
2016-08-04 12:39:33 -05:00
|
|
|
|
|
|
|
EXPOSE 22
|
|
|
|
|
2017-01-17 13:12:43 -06:00
|
|
|
ENTRYPOINT ["/usr/bin/supervisord"]
|