Skip to content

Commit

Permalink
[docker-ptf]: Install python modules from pypi (#788)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-shirshov authored and lguohan committed Jul 6, 2017
1 parent a78d3b1 commit 7792f09
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions dockers/docker-ptf/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -20,46 +20,51 @@ RUN sed --in-place 's/httpredir.debian.org/debian-archive.trafficmanager.net/' /
&& 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 \
less \
ipython \
git \
iputils-ping \
hping3 \
curl

## Reinstall scapy by version from p4lang
RUN git clone https:/p4lang/scapy-vxlan.git && cd scapy-vxlan && python setup.py install
curl \
python \
python-dev \
python-scapy

RUN dpkg -i \
{% for deb in docker_ptf_debs.split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor %}

# Install all python modules from pypi. python-scapy is exception, ptf debian package requires python-scapy
RUN rm -rf /debs \
&& apt-get -y autoclean \
&& apt-get -y autoremove \
&& rm -rf /var/lib/apt/lists/* \
&& 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:/p4lang/scapy-vxlan.git \
&& cd scapy-vxlan \
&& python setup.py install \
&& cd .. \
&& rm -fr scapy-vxlan \
&& wget https:/nanomsg/nanomsg/archive/1.0.0.tar.gz \
&& tar xvfz 1.0.0.tar.gz \
&& cd nanomsg-1.0.0 \
Expand All @@ -71,14 +76,12 @@ RUN rm -rf /debs \
&& 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 cffi \
&& pip install nnpy \
&& pip install dpkt \
&& pip install ipaddress \
&& pip install pysubnettree \
&& pip install paramiko \
&& pip install parallel-ssh \
&& pip install flask \
&& pip install exabgp==3.4.17\
&& mkdir -p /opt \
Expand All @@ -90,8 +93,7 @@ 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
&& sed -i '$aUseDNS no' /etc/ssh/sshd_config

COPY ["supervisord.conf", "sshd.conf", "ptf_nn_agent.conf", "/etc/supervisor/conf.d/"]

Expand Down

0 comments on commit 7792f09

Please sign in to comment.