2022-04-27 19:39:37 -05:00
FROM docker-config-engine-buster-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
2017-10-24 00:01:42 -05:00
2018-06-25 12:48:42 -05:00
ARG docker_container_name
2022-12-14 18:49:37 -06:00
COPY [ "etc/rsyslog.conf" , "/etc/rsyslog.conf" ]
2018-09-11 16:57:29 -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
2017-10-24 00:01:42 -05:00
## Make apt-get non-interactive
ENV DEBIAN_FRONTEND = noninteractive
2019-05-06 09:19:36 -05:00
RUN apt-get install -y gnupg
2017-11-30 16:59:25 -06:00
COPY [ "sonic-dev.gpg.key" , "/etc/apt/" ]
RUN apt-key add /etc/apt/sonic-dev.gpg.key
RUN echo "deb http://packages.microsoft.com/repos/sonic-dev/ jessie main" >> /etc/apt/sources.list
2017-10-24 00:01:42 -05:00
RUN apt-get update
RUN apt-get install -y net-tools \
2017-11-30 16:59:25 -06:00
arping \
Fix potential blackholing/looping traffic when link-local was used and refresh ipv6 neighbor to avoid CPU hit (#1904)
* Fix potential blackholing/looping traffic and refresh ipv6 neighbor to avoid CPU hit
In case ipv6 global addresses were configured on L3 interfaces and used for peering,
and routing protocol was using link-local addresses on the same interfaces as prefered nexthops,
the link-local addresses could be aged out after a while due to no activities towards the link-local
addresses themselves. And when we receive new routes with the link-local nexthops, SONiC won't insert
them to the HW, and thus cause looping or blackholing traffic.
Global ipv6 addresses on L3 interfaces between switches are refreshed by BGP keeplive and other messages.
On server facing side, traffic may hit fowarding plane only, and no refresh for the ipv6 neighbor entries regularly.
This could age-out the linux kernel ipv6 neighbor entries, and HW neighbor table entries could be removed,
and thus traffic going to those neighbors would hit CPU, and cause traffic drop and temperary CPU high load.
Also, if link-local addresses were not learned, we may not get them at all later.
It is intended to fix all above issues.
Changes:
Add ndisc6 package in swss docker and use it for ipv6 ndp ping to update the neighbors' state on Vlan interfaces
Change the default ipv6 neighbor reachable timer to 30mins
Add periodical ipv6 multicast ping to ff02::11 to get/refresh link-local neighbor info.
* Fix review comments:
Add PORTCHANNEL_INTERFACE interface for ipv6 multicast ping
format issue
* Combine regular L3 interface and portchannel interface for looping
* Add ndisc6 package to vs docker
2018-08-12 05:14:55 -05:00
ndisc6 \
2017-10-24 00:01:42 -05:00
ethtool \
tcpdump \
ifupdown \
bridge-utils \
python-ply \
libqt5core5a \
libqt5network5 \
2020-07-18 02:11:09 -05:00
libboost-program-options1.71.0 \
2022-08-08 10:29:51 -05:00
libboost-serialization1.71.0 \
2020-07-18 02:11:09 -05:00
libboost-system1.71.0 \
libboost-thread1.71.0 \
2017-10-24 00:01:42 -05:00
libgmp10 \
libjudydebian1 \
openssh-client \
openssh-server \
libc-ares2 \
2020-07-18 02:11:09 -05:00
iproute2 \
2017-11-30 16:59:25 -06:00
grub2-common \
bash-completion \
libelf1 \
2018-11-06 23:07:12 -06:00
libmnl0 \
logrotate \
apt-utils \
2018-11-09 19:06:09 -06:00
psmisc \
tcpdump \
2020-03-15 15:54:05 -05:00
python-scapy \
conntrack \
2020-06-22 17:38:36 -05:00
iptables \
2020-09-20 22:16:42 -05:00
jq \
2020-10-14 12:16:35 -05:00
libzmq5 \
2022-08-08 10:29:51 -05:00
libzmq3-dev \
uuid-dev \
2020-10-14 12:16:35 -05:00
# For installing Python m2crypto package
# (these can be uninstalled after installation)
build-essential \
python-dev \
2020-12-25 23:29:25 -06:00
python-pip \
2020-10-14 12:16:35 -05:00
python3-dev \
libssl-dev \
swig \
# For using Python m2crypto package
2021-02-08 21:35:08 -06:00
openssl \
# For installing dependent Python packages of sonic-host-services
# (these can be uninstalled after installation)
libcairo2-dev \
libdbus-1-dev \
libgirepository1.0-dev \
libsystemd-dev \
pkg-config \
# For installing dependent Python packages of sonic-host-services
# these packages are needed at runtime
gir1.2-glib-2.0 \
libdbus-1-3 \
libgirepository-1.0-1 \
2022-04-22 03:07:07 -05:00
{ %- if ENABLE_ASAN = = "y" %}
libasan5 \
{ %- endif %}
2022-09-08 11:33:01 -05:00
libsystemd0 \
dbus
2017-10-24 00:01:42 -05:00
2020-11-04 11:31:06 -06:00
# Install redis-server
{ % if CONFIGURED_ARCH = = "armhf" %}
RUN curl -k -o redis-tools_6.0.6-1~bpo10+1_armhf.deb "https://sonicstorage.blob.core.windows.net/packages/redis/redis-tools_6.0.6-1_bpo10+1_armhf.deb?sv=2015-04-05&sr=b&sig=67vHAMxsl%2BS3X1KsqhdYhakJkGdg5FKSPgU8kUiw4as%3D&se=2030-10-24T04%3A22%3A40Z&sp=r"
RUN curl -k -o redis-server_6.0.6-1~bpo10+1_armhf.deb "https://sonicstorage.blob.core.windows.net/packages/redis/redis-server_6.0.6-1_bpo10+1_armhf.deb?sv=2015-04-05&sr=b&sig=xTdayvm0RBguxi9suyv855jKRjU%2FmKQ8nHuct4WSX%2FA%3D&se=2030-10-24T04%3A22%3A05Z&sp=r"
RUN dpkg -i redis-tools_6.0.6-1~bpo10+1_armhf.deb redis-server_6.0.6-1~bpo10+1_armhf.deb || apt-get install -f
RUN rm redis-tools_6.0.6-1~bpo10+1_armhf.deb redis-server_6.0.6-1~bpo10+1_armhf.deb
{ % elif CONFIGURED_ARCH = = "arm64" %}
RUN curl -o redis-tools_6.0.6-1~bpo10+1_arm64.deb "https://sonicstorage.blob.core.windows.net/packages/redis/redis-tools_6.0.6-1_bpo10+1_arm64.deb?sv=2015-04-05&sr=b&sig=GbkJV2wWln3hoz27zKi5erdk3NDKrAFrQriA97bcRCY%3D&se=2030-10-24T04%3A22%3A21Z&sp=r"
RUN curl -o redis-server_6.0.6-1~bpo10+1_arm64.deb "https://sonicstorage.blob.core.windows.net/packages/redis/redis-server_6.0.6-1_bpo10+1_arm64.deb?sv=2015-04-05&sr=b&sig=622w2KzIKIjAaaA0Bz12MzU%2BUBzY2AiXFIFfuKNoKSk%3D&se=2030-10-24T04%3A21%3A44Z&sp=r"
RUN dpkg -i redis-tools_6.0.6-1~bpo10+1_arm64.deb redis-server_6.0.6-1~bpo10+1_arm64.deb || apt-get install -f
RUN rm redis-tools_6.0.6-1~bpo10+1_arm64.deb redis-server_6.0.6-1~bpo10+1_arm64.deb
{ % else %}
2020-09-08 21:30:14 -05:00
RUN curl -o redis-tools_6.0.6-1~bpo10+1_amd64.deb "https://sonicstorage.blob.core.windows.net/packages/redis/redis-tools_6.0.6-1~bpo10+1_amd64.deb?sv=2015-04-05&sr=b&sig=73zbmjkf3pi%2Bn0R8Hy7CWT2EUvOAyzM5aLYJWCLySGM%3D&se=2030-09-06T19%3A44%3A59Z&sp=r"
RUN curl -o redis-server_6.0.6-1~bpo10+1_amd64.deb "https://sonicstorage.blob.core.windows.net/packages/redis/redis-server_6.0.6-1~bpo10+1_amd64.deb?sv=2015-04-05&sr=b&sig=2Ketg7BmkZEaTxR%2FgvAFVmhjn7ywdmkc7l2T2rsL57o%3D&se=2030-09-06T19%3A45%3A20Z&sp=r"
RUN dpkg -i redis-tools_6.0.6-1~bpo10+1_amd64.deb redis-server_6.0.6-1~bpo10+1_amd64.deb || apt-get install -f
RUN rm redis-tools_6.0.6-1~bpo10+1_amd64.deb redis-server_6.0.6-1~bpo10+1_amd64.deb
2020-11-04 11:31:06 -06:00
{ % endif %}
2020-09-08 21:30:14 -05:00
2020-12-25 23:29:25 -06:00
RUN pip2 install --upgrade 'pip<21'
RUN apt-get purge -y python-pip
RUN pip2 install setuptools = = 40.8.0
RUN pip2 install wheel = = 0.33.6
2020-10-26 15:48:50 -05:00
RUN pip2 install py2_ipaddress
RUN pip2 install six
RUN pip2 install pyroute2 = = 0.5.3 netifaces = = 0.10.7
RUN pip2 install monotonic = = 1.5
RUN pip2 install urllib3
RUN pip2 install requests
RUN pip2 install crontab
2017-11-13 16:38:07 -06:00
2020-11-25 12:28:36 -06:00
# For sonic-config-engine Python 3 package
# Install pyangbind here, outside sonic-config-engine dependencies, as pyangbind causes enum34 to be installed.
# Then immediately uninstall enum34, as enum34 should not be installed for Python >= 3.4, as it causes a
# conflict with the new 'enum' module in the standard library
# https://github.com/robshakir/pyangbind/issues/232
RUN pip3 install pyangbind = = 0.8.1
RUN pip3 uninstall -y enum34
2020-12-15 13:06:30 -06:00
# Dependencies of restore_neighbors.py
RUN pip3 install \
scapy = = 2.4.4 \
pyroute2 = = 0.5.14 \
netifaces = = 0.10.9
2018-05-02 13:46:21 -05:00
{ % if docker_sonic_vs_debs.strip( ) -%}
# Copy locally-built Debian package dependencies
2021-01-04 23:57:58 -06:00
COPY { %- for deb in docker_sonic_vs_debs.split( ' ' ) %} debs/{ { deb } } { %- endfor %} /debs/
2017-10-24 00:01:42 -05:00
2018-05-02 13:46:21 -05:00
# Install locally-built Debian packages and implicitly install their dependencies
2021-01-04 23:57:58 -06:00
RUN dpkg_apt( ) { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; { %- for deb in docker_sonic_vs_debs.split( ' ' ) %} dpkg_apt /debs/{ { deb } } ; { %- endfor %}
2018-05-02 13:46:21 -05:00
{ %- endif %}
2019-02-05 00:06:37 -06:00
{ % if docker_sonic_vs_pydebs.strip( ) -%}
# Copy locally-built Debian package dependencies
2021-01-04 23:57:58 -06:00
COPY { %- for deb in docker_sonic_vs_pydebs.split( ' ' ) %} python-debs/{ { deb } } { %- endfor %} /debs/
2019-02-05 00:06:37 -06:00
# Install locally-built Debian packages and implicitly install their dependencies
2021-01-04 23:57:58 -06:00
RUN dpkg_apt( ) { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; { %- for deb in docker_sonic_vs_pydebs.split( ' ' ) %} dpkg_apt /debs/{ { deb } } ; { %- endfor %}
2019-02-05 00:06:37 -06:00
{ %- endif %}
2020-06-22 17:38:36 -05:00
{ % if docker_sonic_vs_whls.strip( ) %}
# copy all whl PKGs first,
2021-01-04 23:57:58 -06:00
copy { %- for whl in docker_sonic_vs_whls.split( ' ' ) %} python-wheels/{ { whl } } { %- endfor %} python-wheels/
2020-06-22 17:38:36 -05:00
# install PKGs after copying all PKGs to avoid dependency failure
# use py3 to find python3 package, which is forced by wheel as of now
{ %- for whl in docker_sonic_vs_whls.split( ' ' ) %}
2020-10-26 15:48:50 -05:00
RUN pip{ % if 'py3' in whl %} 3{ % else %} 2{ % endif %} install python-wheels/{ { whl } }
2020-06-22 17:38:36 -05:00
{ %- endfor %}
{ % endif %}
2018-05-02 13:46:21 -05:00
# Clean up
2020-10-14 12:16:35 -05:00
RUN apt-get purge -y build-essential libssl-dev swig
RUN apt-get purge -y python-dev python3-dev
2021-02-08 21:35:08 -06:00
RUN apt-get purge -y libcairo2-dev libdbus-1-dev libgirepository1.0-dev libsystemd-dev pkg-config
2018-05-02 13:46:21 -05:00
RUN apt-get clean -y
RUN apt-get autoclean -y
RUN apt-get autoremove -y
RUN rm -rf /debs ~/.cache
2017-10-24 00:01:42 -05:00
2017-11-13 16:38:07 -06:00
RUN sed -ri ' s/^( save .*$) /# \1 /g; \
s/^daemonize yes$/daemonize no/; \
2017-10-24 00:01:42 -05:00
s/^logfile .*$/logfile "" /; \
s/^# syslog-enabled no$/syslog-enabled no/; \
2017-11-13 16:38:07 -06:00
s/^# unixsocket/unixsocket/; \
2017-11-30 16:59:25 -06:00
s/notify-keyspace-events "" /notify-keyspace-events AKE/; \
2019-07-04 00:16:10 -05:00
s/redis-server.sock/redis.sock/g; \
2017-11-13 16:38:07 -06:00
s/^client-output-buffer-limit pubsub [ 0-9] +mb [ 0-9] +mb [ 0-9] +/client-output-buffer-limit pubsub 0 0 0/ \
2017-10-24 00:01:42 -05:00
' /etc/redis/redis.conf
COPY [ "50-default.conf" , "/etc/rsyslog.d/" ]
2020-10-14 17:15:24 -05:00
COPY [ "start.sh" , "orchagent.sh" , "files/update_chassisdb_config" , "/usr/bin/" ]
2022-04-22 03:07:07 -05:00
COPY [ "supervisord.conf.j2" , "/usr/share/sonic/templates/" ]
2017-11-30 16:59:25 -06:00
COPY [ "files/configdb-load.sh" , "/usr/bin/" ]
2019-01-30 04:04:20 -06:00
COPY [ "files/arp_update" , "/usr/bin/" ]
2020-11-23 11:31:42 -06:00
COPY [ "files/buffers_config.j2" , "files/qos_config.j2" , "files/arp_update_vars.j2" , "files/copp_cfg.j2" , "/usr/share/sonic/templates/" ]
2018-11-21 00:32:40 -06:00
COPY [ "files/sonic_version.yml" , "/etc/sonic/" ]
2020-11-25 14:47:50 -06:00
COPY [ "port_breakout_config_db.json" , "/etc/sonic/" ]
2019-11-20 12:40:19 -06:00
COPY [ "database_config.json" , "/etc/default/sonic-db/" ]
2020-07-29 16:20:31 -05:00
COPY [ "hostname.j2" , "/usr/share/sonic/templates/" ]
2021-06-23 12:18:55 -05:00
COPY [ "init_cfg.json.j2" , "/usr/share/sonic/templates/" ]
2020-07-29 16:20:31 -05:00
COPY [ "default_chassis_cfg.json" , "/etc/default/sonic-db/" ]
2020-12-13 13:35:39 -06:00
COPY [ "asic_table.json" , "/etc/sonic/" ]
2021-11-24 07:00:23 -06:00
COPY [ "zero_profiles.json" , "/etc/sonic" ]
2020-12-13 13:35:39 -06:00
COPY [ "buffermgrd.sh" , "/usr/bin/" ]
2017-10-24 00:01:42 -05:00
2020-08-20 19:10:58 -05:00
COPY [ "platform.json" , "/usr/share/sonic/device/x86_64-kvm_x86_64-r0/" ]
COPY [ "hwsku.json" , "/usr/share/sonic/device/x86_64-kvm_x86_64-r0/Force10-S6000/" ]
2021-09-15 16:02:03 -05:00
COPY [ "hwsku.json" , "/usr/share/sonic/device/x86_64-kvm_x86_64-r0/brcm_gearbox_vs/" ]
2021-11-02 01:21:06 -05:00
COPY [ "hwsku.json" , "/usr/share/sonic/device/x86_64-kvm_x86_64-r0/Mellanox-SN2700/" ]
2020-08-20 19:10:58 -05:00
2022-04-22 03:07:07 -05:00
RUN mkdir -p /etc/supervisor/conf.d/
RUN sonic-cfggen -a "{\"ENABLE_ASAN\":\"{{ENABLE_ASAN}}\"}" -t /usr/share/sonic/templates/supervisord.conf.j2 > /etc/supervisor/conf.d/supervisord.conf
RUN rm -f /usr/share/sonic/templates/supervisord.conf.j2
2022-06-23 17:38:24 -05:00
{ %- if ENABLE_ASAN = = "y" %}
RUN mkdir -p /var/log/asan
{ %- endif %}
2018-11-09 19:06:09 -06:00
# Workaround the tcpdump issue
RUN mv /usr/sbin/tcpdump /usr/bin/tcpdump
2017-11-13 16:38:07 -06:00
RUN echo "docker-sonic-vs" > /etc/hostname
2019-05-08 01:40:40 -05:00
RUN mkdir -p /etc/quagga
2017-11-30 16:59:25 -06:00
RUN touch /etc/quagga/zebra.conf
2017-11-13 16:38:07 -06:00
2019-05-08 01:40:40 -05:00
# disable integrated vtysh config
RUN rm /etc/frr/frr.conf
2018-11-16 11:40:35 -06:00
# Create /var/warmboot/teamd folder for teammgrd
RUN mkdir -p /var/warmboot/teamd
2020-09-01 15:39:10 -05:00
# Set PLATFORM and HWSKU environment variables
ENV PLATFORM = x86_64-kvm_x86_64-r0
ENV HWSKU = Force10-S6000
2020-11-22 23:18:44 -06:00
ENTRYPOINT [ "/usr/local/bin/supervisord" ]