Skip to content

Commit 7792f09

Browse files
pavel-shirshovlguohan
authored andcommitted
[docker-ptf]: Install python modules from pypi (#788)
1 parent a78d3b1 commit 7792f09

1 file changed

Lines changed: 18 additions & 16 deletions

File tree

dockers/docker-ptf/Dockerfile.j2

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,46 +20,51 @@ RUN sed --in-place 's/httpredir.debian.org/debian-archive.trafficmanager.net/' /
2020
&& apt-get install -y \
2121
openssh-server \
2222
vim \
23-
python \
24-
python-scapy \
2523
net-tools \
26-
python-setuptools \
27-
supervisor \
2824
traceroute \
2925
lsof \
3026
tcpdump \
3127
unzip \
3228
pkg-config \
3329
binutils \
3430
net-tools \
35-
python-pip \
3631
build-essential \
3732
libssl-dev \
3833
libffi-dev \
39-
python-dev \
4034
wget \
4135
cmake \
4236
libqt5core5a \
4337
libqt5network5 \
4438
less \
45-
ipython \
4639
git \
4740
iputils-ping \
4841
hping3 \
49-
curl
50-
51-
## Reinstall scapy by version from p4lang
52-
RUN git clone https://github.com/p4lang/scapy-vxlan.git && cd scapy-vxlan && python setup.py install
42+
curl \
43+
python \
44+
python-dev \
45+
python-scapy
5346

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

52+
# Install all python modules from pypi. python-scapy is exception, ptf debian package requires python-scapy
5953
RUN rm -rf /debs \
6054
&& apt-get -y autoclean \
6155
&& apt-get -y autoremove \
6256
&& rm -rf /var/lib/apt/lists/* \
57+
&& wget --https-only https://bootstrap.pypa.io/get-pip.py \
58+
&& python get-pip.py \
59+
&& rm -f get-pip.py \
60+
&& pip install setuptools \
61+
&& pip install supervisor \
62+
&& pip install ipython==5.4.1 \
63+
&& git clone https://github.com/p4lang/scapy-vxlan.git \
64+
&& cd scapy-vxlan \
65+
&& python setup.py install \
66+
&& cd .. \
67+
&& rm -fr scapy-vxlan \
6368
&& wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \
6469
&& tar xvfz 1.0.0.tar.gz \
6570
&& cd nanomsg-1.0.0 \
@@ -71,14 +76,12 @@ RUN rm -rf /debs \
7176
&& cd ../.. \
7277
&& rm -fr nanomsg-1.0.0 \
7378
&& rm -f 1.0.0.tar.gz \
74-
&& pip install cffi==1.7.0 \
75-
&& pip install --upgrade cffi==1.7.0 \
79+
&& pip install cffi \
7680
&& pip install nnpy \
7781
&& pip install dpkt \
7882
&& pip install ipaddress \
7983
&& pip install pysubnettree \
8084
&& pip install paramiko \
81-
&& pip install parallel-ssh \
8285
&& pip install flask \
8386
&& pip install exabgp==3.4.17\
8487
&& mkdir -p /opt \
@@ -90,8 +93,7 @@ RUN mkdir /var/run/sshd \
9093
&& echo 'root:root' | chpasswd \
9194
&& sed -ri 's/^PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config \
9295
&& sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config \
93-
&& sed -i '$aUseDNS no' /etc/ssh/sshd_config \
94-
&& mkdir /root/deps
96+
&& sed -i '$aUseDNS no' /etc/ssh/sshd_config
9597

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

0 commit comments

Comments
 (0)