2019-06-22 13:26:23 -05:00
|
|
|
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
|
2019-03-22 18:42:56 -05:00
|
|
|
FROM docker-config-engine-stretch
|
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 \
|
|
|
|
python-pip \
|
|
|
|
ipmitool \
|
|
|
|
librrd8 \
|
|
|
|
librrd-dev \
|
|
|
|
rrdtool \
|
|
|
|
python-smbus \
|
|
|
|
ethtool \
|
2020-04-21 10:09:53 -05:00
|
|
|
dmidecode \
|
|
|
|
i2c-tools && \
|
2020-04-14 12:20:06 -05:00
|
|
|
pip install enum34
|
2017-06-11 00:05:11 -05:00
|
|
|
|
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 \
|
|
|
|
python-pip && \
|
|
|
|
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
|
|
|
|
2019-03-22 04:49:35 -05:00
|
|
|
COPY ["docker_init.sh", "lm-sensors.sh", "/usr/bin/"]
|
|
|
|
COPY ["docker-pmon.supervisord.conf.j2", "start.sh.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"]
|