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
|
First cut image update for kubernetes support. (#5421)
* First cut image update for kubernetes support.
With this,
1) dockers dhcp_relay, lldp, pmon, radv, snmp, telemetry are enabled
for kube management
init_cfg.json configure set_owner as kube for these
2) Each docker's start.sh updated to call container_startup.py to register going up
As part of this call, it registers the current owner as local/kube and its version
The images are built with its version ingrained into image during build
3) Update all docker's bash script to call 'container start/stop/wait' instead of 'docker start/stop/wait'.
For all locally managed containers, it calls docker commands, hence no change for locally managed.
4) Introduced a new ctrmgrd service, that helps with transition between owners as kube & local and carry over any labels update from STATE-DB to API server
5) hostcfgd updated to handle owner change
6) Reboot scripts are updatd to tag kube running images as local, so upon reboot they run the same image.
7) Added kube_commands.py to handle all updates with Kubernetes API serrver -- dedicated for k8s interaction only.
2020-12-22 10:01:33 -06:00
|
|
|
ARG image_version
|
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
|
|
|
|
|
First cut image update for kubernetes support. (#5421)
* First cut image update for kubernetes support.
With this,
1) dockers dhcp_relay, lldp, pmon, radv, snmp, telemetry are enabled
for kube management
init_cfg.json configure set_owner as kube for these
2) Each docker's start.sh updated to call container_startup.py to register going up
As part of this call, it registers the current owner as local/kube and its version
The images are built with its version ingrained into image during build
3) Update all docker's bash script to call 'container start/stop/wait' instead of 'docker start/stop/wait'.
For all locally managed containers, it calls docker commands, hence no change for locally managed.
4) Introduced a new ctrmgrd service, that helps with transition between owners as kube & local and carry over any labels update from STATE-DB to API server
5) hostcfgd updated to handle owner change
6) Reboot scripts are updatd to tag kube running images as local, so upon reboot they run the same image.
7) Added kube_commands.py to handle all updates with Kubernetes API serrver -- dedicated for k8s interaction only.
2020-12-22 10:01:33 -06:00
|
|
|
# Pass the image_version to container
|
|
|
|
ENV IMAGE_VERSION=$image_version
|
|
|
|
|
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-12-25 23:29:25 -06:00
|
|
|
build-essential \
|
2020-09-29 15:57:54 -05:00
|
|
|
python3-dev \
|
2019-06-22 13:26:23 -05:00
|
|
|
ipmitool \
|
|
|
|
librrd8 \
|
|
|
|
librrd-dev \
|
|
|
|
rrdtool \
|
2021-01-12 17:05:06 -06:00
|
|
|
python3-smbus \
|
2020-04-21 10:09:53 -05:00
|
|
|
dmidecode \
|
2021-05-07 00:24:07 -05:00
|
|
|
i2c-tools \
|
2021-06-30 11:35:16 -05:00
|
|
|
psmisc \
|
2021-08-03 20:08:09 -05:00
|
|
|
python3-jsonschema \
|
2021-06-30 11:35:16 -05:00
|
|
|
libpci3
|
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.
|
2021-10-26 20:09:32 -05:00
|
|
|
RUN pip3 install grpcio==1.39.0 \
|
|
|
|
grpcio-tools==1.39.0
|
2020-11-04 13:23:03 -06:00
|
|
|
|
2020-12-04 10:41:17 -06:00
|
|
|
# Barefoot platform vendors' sonic_platform packages import the Python 'thrift' library
|
|
|
|
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
|
|
|
|
2020-12-25 23:29:25 -06:00
|
|
|
|
2017-06-11 00:05:11 -05:00
|
|
|
# Clean up
|
2019-06-22 13:26:23 -05:00
|
|
|
RUN apt-get purge -y \
|
2020-12-25 23:29:25 -06:00
|
|
|
build-essential \
|
2020-10-30 11:43:14 -05:00
|
|
|
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
|
|
|
|
2021-05-06 12:13:26 -05:00
|
|
|
COPY ["lm-sensors.sh", "/usr/bin/"]
|
|
|
|
COPY ["docker-pmon.supervisord.conf.j2", "docker_init.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
|
|
|
|
2021-05-06 12:13:26 -05:00
|
|
|
RUN sonic-cfggen -a "{\"CONFIGURED_PLATFORM\":\"{{CONFIGURED_PLATFORM}}\"}" -t /usr/share/sonic/templates/docker_init.j2 > /usr/bin/docker_init.sh
|
|
|
|
RUN rm -f /usr/share/sonic/templates/docker_init.j2
|
|
|
|
RUN chmod 755 /usr/bin/docker_init.sh
|
|
|
|
|
2019-03-22 04:49:35 -05:00
|
|
|
ENTRYPOINT ["/usr/bin/docker_init.sh"]
|