2019-06-22 13:26:23 -05:00
|
|
|
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
|
2020-07-18 05:46:15 -05:00
|
|
|
FROM docker-config-engine-buster
|
2017-06-11 00:05:11 -05: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
|
|
|
|
2017-06-11 00:05:11 -05:00
|
|
|
# Make apt-get non-interactive
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
2017-06-23 17:23:00 -05:00
|
|
|
# Install required packages
|
2019-06-22 13:26:23 -05:00
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y \
|
2020-10-30 11:43:14 -05:00
|
|
|
python-dev \
|
2020-09-29 15:57:54 -05:00
|
|
|
python3-dev \
|
2019-06-22 13:26:23 -05:00
|
|
|
ipmitool \
|
|
|
|
librrd8 \
|
|
|
|
librrd-dev \
|
|
|
|
rrdtool \
|
|
|
|
python-smbus \
|
|
|
|
ethtool \
|
2020-04-21 10:09:53 -05:00
|
|
|
dmidecode \
|
2020-11-12 12:22:38 -06:00
|
|
|
i2c-tools \
|
|
|
|
python-jsonschema
|
2020-09-29 15:57:54 -05:00
|
|
|
|
2020-11-04 13:23:03 -06:00
|
|
|
# On Arista devices, the sonic_platform wheel is not installed in the container.
|
|
|
|
# Instead, the installation directory is mounted from the host OS. However, this method
|
|
|
|
# doesn't ensure all dependencies are installed in the container. So here we
|
|
|
|
# install any dependencies required by the Arista sonic_platform package.
|
|
|
|
# TODO: eliminate the need to install these explicitly.
|
|
|
|
# NOTE: Only install enum34 for Python 2, as our version of Python 3 is 3.7, which
|
|
|
|
# contains 'enum' as part of the standard library. Installing enum34 there will
|
|
|
|
# cause conflicts.
|
|
|
|
RUN pip2 install enum34
|
|
|
|
|
2020-12-04 10:41:17 -06:00
|
|
|
# Barefoot platform vendors' sonic_platform packages import the Python 'thrift' library
|
|
|
|
RUN pip2 install thrift==0.13.0
|
|
|
|
RUN pip3 install thrift==0.13.0
|
|
|
|
|
2018-01-22 12:52:52 -06:00
|
|
|
{% if docker_platform_monitor_debs.strip() -%}
|
2018-04-20 12:42:19 -05:00
|
|
|
# Copy locally-built Debian package dependencies
|
2019-06-22 13:26:23 -05:00
|
|
|
{{ copy_files("debs/", docker_platform_monitor_debs.split(' '), "/debs/") }}
|
2018-04-20 12:42:19 -05:00
|
|
|
|
|
|
|
# Install locally-built Debian packages and implicitly install their dependencies
|
2019-06-22 13:26:23 -05:00
|
|
|
{{ install_debian_packages(docker_platform_monitor_debs.split(' ')) }}
|
2018-04-20 12:42:19 -05:00
|
|
|
{%- endif %}
|
2017-06-11 00:05:11 -05:00
|
|
|
|
2019-02-05 00:06:37 -06:00
|
|
|
{% if docker_platform_monitor_pydebs.strip() -%}
|
|
|
|
# Copy locally-built Debian package dependencies
|
2019-06-22 13:26:23 -05:00
|
|
|
{{ copy_files("python-debs/", docker_platform_monitor_pydebs.split(' '), "/debs/") }}
|
2019-02-05 00:06:37 -06:00
|
|
|
|
|
|
|
# Install locally-built Debian packages and implicitly install their dependencies
|
2019-06-22 13:26:23 -05:00
|
|
|
{{ install_debian_packages(docker_platform_monitor_pydebs.split(' ')) }}
|
2019-02-05 00:06:37 -06:00
|
|
|
{%- endif %}
|
|
|
|
|
2018-01-22 12:52:52 -06:00
|
|
|
{% if docker_platform_monitor_whls.strip() -%}
|
2018-04-20 12:42:19 -05:00
|
|
|
# Copy locally-built Python wheel dependencies
|
2019-06-22 13:26:23 -05:00
|
|
|
{{ copy_files("python-wheels/", docker_platform_monitor_whls.split(' '), "/python-wheels/") }}
|
2018-04-20 12:42:19 -05:00
|
|
|
|
|
|
|
# Install locally-built Python wheel dependencies
|
2019-06-22 13:26:23 -05:00
|
|
|
{{ install_python_wheels(docker_platform_monitor_whls.split(' ')) }}
|
2018-01-22 12:52:52 -06:00
|
|
|
{% endif %}
|
2017-06-11 00:05:11 -05:00
|
|
|
|
|
|
|
# Clean up
|
2019-06-22 13:26:23 -05:00
|
|
|
RUN apt-get purge -y \
|
2020-10-30 11:43:14 -05:00
|
|
|
python-dev \
|
|
|
|
python3-dev && \
|
2019-06-22 13:26:23 -05:00
|
|
|
apt-get clean -y && \
|
|
|
|
apt-get autoclean -y && \
|
|
|
|
apt-get autoremove -y && \
|
|
|
|
rm -rf /debs \
|
|
|
|
/python-wheels \
|
|
|
|
~/.cache
|
2017-06-11 00:05:11 -05:00
|
|
|
|
2020-05-15 20:00:47 -05:00
|
|
|
COPY ["docker_init.sh", "lm-sensors.sh", "start.sh", "/usr/bin/"]
|
|
|
|
COPY ["docker-pmon.supervisord.conf.j2", "/usr/share/sonic/templates/"]
|
2019-10-04 12:52:58 -05:00
|
|
|
COPY ["ssd_tools/*", "/usr/bin/"]
|
2019-11-04 19:44:01 -06:00
|
|
|
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
|
|
|
|
COPY ["critical_processes", "/etc/supervisor"]
|
2017-06-11 00:05:11 -05:00
|
|
|
|
2019-03-22 04:49:35 -05:00
|
|
|
ENTRYPOINT ["/usr/bin/docker_init.sh"]
|