2019-06-22 13:26:23 -05:00
|
|
|
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
|
2020-07-29 16:19:03 -05:00
|
|
|
FROM docker-config-engine-buster
|
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-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
|
|
|
|
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 \
|
|
|
|
libjson-c3 \
|
|
|
|
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"]
|
2020-03-03 18:50:32 -06:00
|
|
|
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
|
|
|
|
COPY ["critical_processes", "/etc/supervisor"]
|
2021-01-19 02:23:36 -06:00
|
|
|
COPY ["bgpd.sh", "/usr/bin/"]
|
2019-07-26 16:31:56 -05:00
|
|
|
RUN chmod a+x /usr/bin/TSA && \
|
|
|
|
chmod a+x /usr/bin/TSB && \
|
|
|
|
chmod a+x /usr/bin/TSC
|
2019-05-09 01:00:49 -05:00
|
|
|
|
2020-05-14 16:58:43 -05:00
|
|
|
ENTRYPOINT ["/usr/bin/docker_init.sh"]
|