2019-06-22 13:26:23 -05:00
|
|
|
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
|
2022-08-21 19:04:47 -05:00
|
|
|
FROM docker-swss-layer-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
|
2016-12-05 13:12:19 -06:00
|
|
|
|
2018-06-25 12:48:42 -05:00
|
|
|
ARG docker_container_name
|
2018-11-26 20:19:12 -06:00
|
|
|
ARG frr_user_uid
|
|
|
|
ARG frr_user_gid
|
|
|
|
|
2018-06-25 12:48:42 -05:00
|
|
|
|
2018-06-22 20:46:05 -05:00
|
|
|
# Make apt-get non-interactive
|
2017-02-16 23:48:49 -06:00
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
2018-06-22 20:46:05 -05:00
|
|
|
# Update apt's cache of available packages
|
|
|
|
# Install required packages
|
2019-06-22 13:26:23 -05:00
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y \
|
|
|
|
libc-ares2 \
|
|
|
|
iproute2 \
|
|
|
|
logrotate \
|
|
|
|
libunwind8
|
2016-12-05 13:12:19 -06:00
|
|
|
|
2018-11-26 20:19:12 -06:00
|
|
|
RUN groupadd -g ${frr_user_gid} frr
|
|
|
|
RUN useradd -u ${frr_user_uid} -g ${frr_user_gid} -M -s /bin/false frr
|
|
|
|
|
2019-06-22 13:26:23 -05:00
|
|
|
{% if docker_fpm_frr_debs.strip() -%}
|
|
|
|
# Copy locally-built Debian package dependencies
|
|
|
|
{{ copy_files("debs/", docker_fpm_frr_debs.split(' '), "/debs/") }}
|
|
|
|
|
2018-06-22 20:46:05 -05:00
|
|
|
# Install locally-built Debian packages and implicitly install their dependencies
|
2019-06-22 13:26:23 -05:00
|
|
|
{{ install_debian_packages(docker_fpm_frr_debs.split(' ')) }}
|
2018-06-22 20:46:05 -05:00
|
|
|
{%- endif %}
|
2016-12-05 13:12:19 -06:00
|
|
|
|
2020-06-20 23:01:24 -05:00
|
|
|
{% if docker_fpm_frr_whls.strip() %}
|
|
|
|
# Copy locally-built Python wheel dependencies
|
|
|
|
{{ copy_files("python-wheels/", docker_fpm_frr_whls.split(' '), "/python-wheels/") }}
|
|
|
|
|
|
|
|
# Install locally-built Python wheel dependencies
|
|
|
|
{{ install_python_wheels(docker_fpm_frr_whls.split(' ')) }}
|
|
|
|
{% endif %}
|
|
|
|
|
2019-05-16 12:59:12 -05:00
|
|
|
RUN chown -R ${frr_user_uid}:${frr_user_gid} /etc/frr/
|
|
|
|
|
2018-06-22 20:46:05 -05:00
|
|
|
# Clean up
|
2019-06-22 13:26:23 -05:00
|
|
|
RUN apt-get clean -y && \
|
|
|
|
apt-get autoclean -y && \
|
|
|
|
apt-get autoremove -y && \
|
2020-06-20 23:01:24 -05:00
|
|
|
rm -rf /debs ~/.cache /python-wheels
|
2016-12-05 13:12:19 -06:00
|
|
|
|
2020-04-23 11:42:22 -05:00
|
|
|
COPY ["frr", "/usr/share/sonic/templates"]
|
2020-06-20 23:01:24 -05:00
|
|
|
COPY ["docker_init.sh", "/usr/bin/"]
|
2019-06-19 03:24:42 -05:00
|
|
|
COPY ["snmp.conf", "/etc/snmp/frr.conf"]
|
2019-07-26 16:31:56 -05:00
|
|
|
COPY ["TSA", "/usr/bin/TSA"]
|
|
|
|
COPY ["TSB", "/usr/bin/TSB"]
|
|
|
|
COPY ["TSC", "/usr/bin/TSC"]
|
2021-02-12 12:56:44 -06:00
|
|
|
COPY ["TS", "/usr/bin/TS"]
|
2020-03-03 18:50:32 -06:00
|
|
|
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
|
2021-01-27 14:36:02 -06:00
|
|
|
COPY ["zsocket.sh", "/usr/bin/"]
|
2019-07-26 16:31:56 -05:00
|
|
|
RUN chmod a+x /usr/bin/TSA && \
|
|
|
|
chmod a+x /usr/bin/TSB && \
|
2021-01-27 14:36:02 -06:00
|
|
|
chmod a+x /usr/bin/TSC && \
|
|
|
|
chmod a+x /usr/bin/zsocket.sh
|
2019-05-09 01:00:49 -05:00
|
|
|
|
2024-01-31 20:14:20 -06:00
|
|
|
{% if include_system_eventd == "y" %}
|
|
|
|
{% if build_reduce_image_size != "y" or sonic_asic_platform != "broadcom" %}
|
|
|
|
COPY ["*.json", "/etc/rsyslog.d/"]
|
|
|
|
COPY ["files/rsyslog_plugin.conf.j2", "/etc/rsyslog.d/"]
|
2022-09-21 11:20:53 -05:00
|
|
|
RUN j2 -f json /etc/rsyslog.d/rsyslog_plugin.conf.j2 /etc/rsyslog.d/events_info.json > /etc/rsyslog.d/bgp_events.conf
|
|
|
|
RUN rm -f /etc/rsyslog.d/rsyslog_plugin.conf.j2
|
|
|
|
RUN rm -f /etc/rsyslog.d/events_info.json
|
2024-01-31 20:14:20 -06:00
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
2022-09-03 09:33:25 -05:00
|
|
|
|
2020-05-14 16:58:43 -05:00
|
|
|
ENTRYPOINT ["/usr/bin/docker_init.sh"]
|