sonic-buildimage/dockers/docker-ptf-sai/Dockerfile.j2
Richard.Yu 47d63bcd06
[SAI PTF] SAI PTF docker support sai-ptf v2 (#12719)
* [SAI PTF] SAI PTF docker support sai-ptf v2

Publish the sai-ptf docker.

Take part of the change from previous PR #11610 (already reverted as some cache issue)
Cause in #11610, added two new target in it, one is sai-ptf another one is syncd-rpc with sai-ptf v2, to make the upgrade with more clear target, use this one take the sai-ptf one.

Test one:
NOSTRETCH=y NOJESSIE=y make configure PLATFORM=vs
NOSTRETCH=y NOJESSIE=y NOBULLSEYE=y SAITHRIFT_V2=y make target/docker-ptf-sai.gz

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* remove useless change

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* remove useless parameters

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* remove useless change

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* Update azure-pipelines-build.yml

remove a useless option

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>
2022-11-17 04:42:51 -08:00

46 lines
1.4 KiB
Django/Jinja

{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
FROM docker-ptf-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
# 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_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
run echo "declare -x LANG=\"C.UTF-8\"" >> /root/.bashrc
run echo "declare -x LC_ALL=\"C.UTF-8\"" >> /root/.bashrc
run echo "declare -x PYTHONIOENCODING=\"UTF-8\"" >> /root/.bashrc
run echo "declare -x VIRTUAL_ENV=\"/root/env-python3\"" >> /root/.bashrc