sonic-buildimage/dockers/docker-ptf-sai/Dockerfile.j2
Yang Wang ab7d6516d4
[Cherry-pick] Add ptf docker for PTF-SAI testing (#10249)
Why I did it
To enable PTF-SAI testing on 202111 branch, cherry-pick necessary PR from master

How I did it
Based on the current ptf docker create a new docker for sai-ptf(saiv2)
upgrade related package
use the latest ptf and install it

How to verify it
Tested on DUT

* [PTF-SAIv2]Add ptf docker for sai-ptf (saiv2) (#9729)

* [PTF-SAIv2]Add ptf dockre for sai-ptf (saiv2)

Base on current ptf docker create a new docker for sai-ptf(saiv2)
upgrade related package
use the latest ptf and install it

test done:
NOJESSIE=1 NOSTRETCH=1 NOBULLSEYE=1 ENABLE_SYNCD_RPC=y make target/docker-ptf-sai.gz
BLDENV=buster make -f Makefile.work target/docker-ptf-sai.gz

* upgrade the thrift to 014

* install xmlrunner python3 version (#10086)

Co-authored-by: Yang Wang <yangwang1@microsoft.com>
2022-03-17 10:34:44 +08:00

42 lines
1.2 KiB
Django/Jinja

{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
FROM docker-ptf
# Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive
# Set the apt source, update package cache and install necessary packages
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get dist-upgrade -y \
&& apt-get install -y \
python3-pip
RUN pip3 install crc16 \
netifaces \
getmac \
packet_helper \
psutil \
scapy==2.4.4 \
scapy_helper \
pysubnettree \
xmlrunner
COPY \
{% for deb in docker_ptf_sai_debs.split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor -%}
debs/
RUN dpkg -i \
{% for deb in docker_ptf_sai_debs.split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor %}
# Remove old ptf package
RUN dpkg -r python-ptf
# Install new ptf package
RUN git clone https://github.com/p4lang/ptf.git \
&& cd ptf \
&& python3.7 setup.py install --single-version-externally-managed --record /tmp/ptf_install.txt