2022-02-18 03:48:50 -06:00
|
|
|
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
|
2022-04-27 19:39:37 -05:00
|
|
|
FROM docker-ptf-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
|
2022-02-18 03:48:50 -06:00
|
|
|
|
|
|
|
# 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 \
|
2022-02-27 21:21:04 -06:00
|
|
|
pysubnettree \
|
|
|
|
xmlrunner
|
2022-02-18 03:48:50 -06:00
|
|
|
|
|
|
|
COPY \
|
|
|
|
{% for deb in docker_ptf_sai_debs.split(' ') -%}
|
|
|
|
debs/{{ deb }}{{' '}}
|
2022-11-16 22:28:30 -06:00
|
|
|
{%- endfor -%}
|
2022-02-18 03:48:50 -06:00
|
|
|
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
|