2019-06-22 13:26:23 -05:00
|
|
|
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
|
2021-11-24 19:00:14 -06:00
|
|
|
FROM docker-swss-layer-buster
|
2016-12-05 13:12:19 -06:00
|
|
|
|
2018-06-25 12:48:42 -05:00
|
|
|
ARG docker_container_name
|
2018-08-13 00:23:58 -05:00
|
|
|
RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf
|
2018-06-25 12:48:42 -05:00
|
|
|
|
2020-10-26 15:48:50 -05:00
|
|
|
# Make apt-get non-interactive
|
2017-02-16 23:48:49 -06:00
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
2019-06-22 13:26:23 -05:00
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -f -y \
|
|
|
|
ifupdown \
|
|
|
|
arping \
|
|
|
|
iproute2 \
|
|
|
|
ndisc6 \
|
|
|
|
tcpdump \
|
|
|
|
libelf1 \
|
|
|
|
libmnl0 \
|
2020-01-29 19:40:43 -06:00
|
|
|
bridge-utils \
|
2020-10-05 10:48:13 -05:00
|
|
|
conntrack \
|
2020-10-26 15:48:50 -05:00
|
|
|
ndppd \
|
2021-12-17 10:43:25 -06:00
|
|
|
pciutils \
|
2020-10-26 15:48:50 -05:00
|
|
|
# Needed for installing netifaces Python package
|
|
|
|
build-essential \
|
|
|
|
python3-dev
|
2019-06-22 13:26:23 -05:00
|
|
|
|
2019-09-11 11:41:38 -05:00
|
|
|
{% if ( CONFIGURED_ARCH == "armhf" or CONFIGURED_ARCH == "arm64" ) %}
|
2021-08-05 09:00:50 -05:00
|
|
|
# Fix for gcc/python/iputils-ping not found in arm docker
|
2019-09-11 11:41:38 -05:00
|
|
|
RUN apt-get install -f -y python2.7 python2.7-dev
|
2021-08-05 09:00:50 -05:00
|
|
|
RUN apt-get install -y \
|
|
|
|
gcc-8 \
|
|
|
|
iputils-ping
|
2019-09-11 11:41:38 -05:00
|
|
|
{% endif %}
|
|
|
|
{% if CONFIGURED_ARCH == "armhf" %}
|
2020-12-03 14:38:50 -06:00
|
|
|
RUN ln -s -f /usr/bin/gcc-8 /usr/bin/arm-linux-gnueabihf-gcc
|
2019-09-11 11:41:38 -05:00
|
|
|
{% endif %}
|
|
|
|
{% if CONFIGURED_ARCH == "arm64" %}
|
2020-12-03 14:38:50 -06:00
|
|
|
RUN ln -s -f /usr/bin/gcc-8 /usr/bin/aarch64-linux-gnu-gcc
|
2019-07-26 00:06:41 -05:00
|
|
|
{% endif %}
|
|
|
|
|
2020-12-15 13:06:30 -06:00
|
|
|
# Dependencies of restore_neighbors.py
|
|
|
|
RUN pip3 install \
|
|
|
|
pyroute2==0.5.14 \
|
|
|
|
netifaces==0.10.9
|
|
|
|
|
2019-09-11 11:41:38 -05:00
|
|
|
{% if ( CONFIGURED_ARCH == "armhf" or CONFIGURED_ARCH == "arm64" ) %}
|
2019-07-26 00:06:41 -05:00
|
|
|
# Remove installed gcc
|
2020-12-03 14:38:50 -06:00
|
|
|
RUN apt-get remove -y gcc-8
|
2019-07-26 00:06:41 -05:00
|
|
|
{% endif %}
|
|
|
|
|
2019-06-22 13:26:23 -05:00
|
|
|
{% if docker_orchagent_debs.strip() -%}
|
|
|
|
# Copy locally-built Debian package dependencies
|
|
|
|
{{ copy_files("debs/", docker_orchagent_debs.split(' '), "/debs/") }}
|
|
|
|
|
|
|
|
# Install locally-built Debian packages and implicitly install their dependencies
|
|
|
|
{{ install_debian_packages(docker_orchagent_debs.split(' ')) }}
|
|
|
|
{%- endif %}
|
2016-12-05 13:12:19 -06:00
|
|
|
|
[scapy] update scapy to 2.4.5 and patch it (#10457)
Why I did it
Running warm-reboot in a loop for 500 times leads to this error on 318-th iteration:
Apr 2 15:56:27.346747 sonic INFO swss#/supervisord: restore_neighbors Traceback (most recent call last):
Apr 2 15:56:27.346747 sonic INFO swss#/supervisord: restore_neighbors File "/usr/bin/restore_neighbors.py", line 24, in <module>
Apr 2 15:56:27.346747 sonic INFO swss#/supervisord: restore_neighbors from scapy.all import conf, in6_getnsma, inet_pton, inet_ntop, in6_getnsmac, get_if_hwaddr, Ether, ARP, IPv6, ICMPv6ND_NS, ICMPv6NDOptSrcLLAddr
Apr 2 15:56:27.346795 sonic INFO swss#/supervisord: restore_neighbors File "/usr/local/lib/python3.7/dist-packages/scapy/all.py", line 25, in <module>
Apr 2 15:56:27.346956 sonic INFO swss#/supervisord: restore_neighbors from scapy.route import *
Apr 2 15:56:27.346995 sonic INFO swss#/supervisord: restore_neighbors File "/usr/local/lib/python3.7/dist-packages/scapy/route.py", line 205, in <module>
Apr 2 15:56:27.347089 sonic INFO swss#/supervisord: restore_neighbors conf.iface = get_working_if()
Apr 2 15:56:27.347129 sonic INFO swss#/supervisord: restore_neighbors File "/usr/local/lib/python3.7/dist-packages/scapy/arch/linux.py", line 128, in get_working_if
Apr 2 15:56:27.347213 sonic INFO swss#/supervisord: restore_neighbors ifflags = struct.unpack("16xH14x", get_if(i, SIOCGIFFLAGS))[0]
Apr 2 15:56:27.347250 sonic INFO swss#/supervisord: restore_neighbors File "/usr/local/lib/python3.7/dist-packages/scapy/arch/common.py", line 31, in get_if
Apr 2 15:56:27.347345 sonic INFO swss#/supervisord: restore_neighbors return ioctl(sck, cmd, struct.pack("16s16x", iff.encode("utf8")))
Apr 2 15:56:27.347365 sonic INFO swss#/supervisord: restore_neighbors OSError: [Errno 19] No such device
The issue was reported to scapy devs secdev/scapy#3369, the fix is secdev/scapy#3371, however there is no released scapy version with this fix right now, thus decided to build scapy v2.4.5 from sources and apply the fix in a form of a patch.
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
2022-04-07 06:23:35 -05:00
|
|
|
{% if docker_orchagent_whls.strip() -%}
|
|
|
|
# Copy locally-built Python wheel dependencies
|
|
|
|
{{ copy_files("python-wheels/", docker_orchagent_whls.split(' '), "/python-wheels/") }}
|
|
|
|
|
|
|
|
# Install locally-built Python wheel dependencies
|
|
|
|
{{ install_python_wheels(docker_orchagent_whls.split(' ')) }}
|
|
|
|
{% endif %}
|
|
|
|
|
2020-10-26 15:48:50 -05:00
|
|
|
# Clean up
|
|
|
|
RUN apt-get purge -y \
|
|
|
|
build-essential \
|
|
|
|
python3-dev && \
|
|
|
|
apt-get clean -y && \
|
|
|
|
apt-get autoclean -y && \
|
|
|
|
apt-get autoremove -y && \
|
2022-03-29 12:11:28 -05:00
|
|
|
rm -rf /debs ~/.cache
|
2016-12-05 13:12:19 -06:00
|
|
|
|
2017-11-30 16:59:25 -06:00
|
|
|
COPY ["files/arp_update", "/usr/bin"]
|
2020-09-18 20:44:23 -05:00
|
|
|
COPY ["arp_update.conf", "files/arp_update_vars.j2", "/usr/share/sonic/templates/"]
|
2022-08-05 13:33:37 -05:00
|
|
|
COPY ["ndppd.conf", "tunnel_packet_handler.conf", "/usr/share/sonic/templates/"]
|
2021-12-14 16:45:23 -06:00
|
|
|
COPY ["enable_counters.py", "tunnel_packet_handler.py", "/usr/bin/"]
|
2020-12-13 13:35:39 -06:00
|
|
|
COPY ["docker-init.sh", "orchagent.sh", "swssconfig.sh", "buffermgrd.sh", "/usr/bin/"]
|
2017-05-08 17:43:31 -05:00
|
|
|
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
|
2019-05-01 10:02:38 -05:00
|
|
|
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
|
|
|
|
COPY ["critical_processes", "/etc/supervisor/"]
|
2017-10-29 13:50:57 -05:00
|
|
|
|
2020-10-26 15:48:50 -05:00
|
|
|
# Copy all Jinja2 template files into the templates folder
|
2017-10-29 13:50:57 -05:00
|
|
|
COPY ["*.j2", "/usr/share/sonic/templates/"]
|
2017-05-08 17:43:31 -05:00
|
|
|
|
2020-05-15 19:09:16 -05:00
|
|
|
ENTRYPOINT ["/usr/bin/docker-init.sh"]
|