[docker-ptf]: Install python modules from pypi (#788)

This commit is contained in:
pavel-shirshov 2017-07-06 02:27:05 -07:00 committed by lguohan
parent a78d3b1a9f
commit 7792f09437

View File

@ -20,11 +20,7 @@ RUN sed --in-place 's/httpredir.debian.org/debian-archive.trafficmanager.net/' /
&& apt-get install -y \ && apt-get install -y \
openssh-server \ openssh-server \
vim \ vim \
python \
python-scapy \
net-tools \ net-tools \
python-setuptools \
supervisor \
traceroute \ traceroute \
lsof \ lsof \
tcpdump \ tcpdump \
@ -32,34 +28,43 @@ RUN sed --in-place 's/httpredir.debian.org/debian-archive.trafficmanager.net/' /
pkg-config \ pkg-config \
binutils \ binutils \
net-tools \ net-tools \
python-pip \
build-essential \ build-essential \
libssl-dev \ libssl-dev \
libffi-dev \ libffi-dev \
python-dev \
wget \ wget \
cmake \ cmake \
libqt5core5a \ libqt5core5a \
libqt5network5 \ libqt5network5 \
less \ less \
ipython \
git \ git \
iputils-ping \ iputils-ping \
hping3 \ hping3 \
curl curl \
python \
## Reinstall scapy by version from p4lang python-dev \
RUN git clone https://github.com/p4lang/scapy-vxlan.git && cd scapy-vxlan && python setup.py install python-scapy
RUN dpkg -i \ RUN dpkg -i \
{% for deb in docker_ptf_debs.split(' ') -%} {% for deb in docker_ptf_debs.split(' ') -%}
debs/{{ deb }}{{' '}} debs/{{ deb }}{{' '}}
{%- endfor %} {%- endfor %}
# Install all python modules from pypi. python-scapy is exception, ptf debian package requires python-scapy
RUN rm -rf /debs \ RUN rm -rf /debs \
&& apt-get -y autoclean \ && apt-get -y autoclean \
&& apt-get -y autoremove \ && apt-get -y autoremove \
&& rm -rf /var/lib/apt/lists/* \ && 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://github.com/p4lang/scapy-vxlan.git \
&& cd scapy-vxlan \
&& python setup.py install \
&& cd .. \
&& rm -fr scapy-vxlan \
&& wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \ && wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \
&& tar xvfz 1.0.0.tar.gz \ && tar xvfz 1.0.0.tar.gz \
&& cd nanomsg-1.0.0 \ && cd nanomsg-1.0.0 \
@ -71,14 +76,12 @@ RUN rm -rf /debs \
&& cd ../.. \ && cd ../.. \
&& rm -fr nanomsg-1.0.0 \ && rm -fr nanomsg-1.0.0 \
&& rm -f 1.0.0.tar.gz \ && rm -f 1.0.0.tar.gz \
&& pip install cffi==1.7.0 \ && pip install cffi \
&& pip install --upgrade cffi==1.7.0 \
&& pip install nnpy \ && pip install nnpy \
&& pip install dpkt \ && pip install dpkt \
&& pip install ipaddress \ && pip install ipaddress \
&& pip install pysubnettree \ && pip install pysubnettree \
&& pip install paramiko \ && pip install paramiko \
&& pip install parallel-ssh \
&& pip install flask \ && pip install flask \
&& pip install exabgp==3.4.17\ && pip install exabgp==3.4.17\
&& mkdir -p /opt \ && mkdir -p /opt \
@ -90,8 +93,7 @@ RUN mkdir /var/run/sshd \
&& echo 'root:root' | chpasswd \ && echo 'root:root' | chpasswd \
&& sed -ri 's/^PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config \ && sed -ri 's/^PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config \
&& sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config \ && sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config \
&& sed -i '$aUseDNS no' /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/"] COPY ["supervisord.conf", "sshd.conf", "ptf_nn_agent.conf", "/etc/supervisor/conf.d/"]