8f348399f5
- Consolidate config.sh and start.sh scripts into one script (start.sh) - Solve issue #435 - All dockers now run supervisord as their ENTRYPOINT - All stdout/stderr output from processes managed by supervisord is now sent to syslog instead of their own files - Supervisord log messages are now also sent to syslog - Removed unused smartmontools package from docker-platform-monitor
90 lines
2.5 KiB
Django/Jinja
90 lines
2.5 KiB
Django/Jinja
FROM debian:jessie
|
|
|
|
MAINTAINER Pavel Shirshov
|
|
|
|
## Copy dependencies
|
|
COPY \
|
|
{% for deb in docker_ptf_debs.split(' ') -%}
|
|
debs/{{ deb }}{{' '}}
|
|
{%- endfor -%}
|
|
debs/
|
|
|
|
## Make apt-get non-interactive
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
## Set the apt source, update package cache and install necessary packages
|
|
RUN sed --in-place 's/httpredir.debian.org/debian-archive.trafficmanager.net/' /etc/apt/sources.list \
|
|
&& apt-get update \
|
|
&& apt-get upgrade -y \
|
|
&& apt-get dist-upgrade -y \
|
|
&& apt-get install -y \
|
|
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 \
|
|
libqt5core5a \
|
|
libqt5network5 \
|
|
iputils-ping
|
|
|
|
|
|
RUN dpkg -i \
|
|
{% for deb in docker_ptf_debs.split(' ') -%}
|
|
debs/{{ deb }}{{' '}}
|
|
{%- endfor %}
|
|
|
|
RUN rm -rf /debs \
|
|
&& 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 \
|
|
&& cd build \
|
|
&& cmake .. \
|
|
&& make install \
|
|
&& ldconfig \
|
|
&& cd ../.. \
|
|
&& rm -fr nanomsg-1.0.0 \
|
|
&& rm -f 1.0.0.tar.gz \
|
|
&& pip install cffi==1.7.0 \
|
|
&& pip install --upgrade cffi==1.7.0 \
|
|
&& pip install nnpy \
|
|
&& pip install dpkt \
|
|
&& pip install ipaddress \
|
|
&& pip install pysubnettree \
|
|
&& 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
|
|
|
|
COPY ["supervisord.conf", "sshd.conf", "ptf_nn_agent.conf", "/etc/supervisor/conf.d/"]
|
|
|
|
EXPOSE 22
|
|
|
|
ENTRYPOINT ["/usr/bin/supervisord"]
|