diff --git a/.gitignore b/.gitignore index 268e1f6c7d..e9c5da1caa 100644 --- a/.gitignore +++ b/.gitignore @@ -29,7 +29,6 @@ dockers/docker-lldp-sv2/Dockerfile dockers/docker-orchagent/Dockerfile dockers/docker-snmp-sv2/Dockerfile dockers/docker-team/Dockerfile -dockers/docker-platform-monitor/Dockerfile -dockers/docker-dhcp-relay/Dockerfile dockers/docker-teamd/Dockerfile +dockers/docker-config-engine/Dockerfile platform/broadcom/docker-syncd-brcm/Dockerfile diff --git a/dockers/docker-config-engine/Dockerfile.j2 b/dockers/docker-config-engine/Dockerfile.j2 new file mode 100644 index 0000000000..56ed38f10f --- /dev/null +++ b/dockers/docker-config-engine/Dockerfile.j2 @@ -0,0 +1,21 @@ +FROM docker-base + +RUN apt-get update + +# Dependencies for sonic-cfggen +RUN apt-get install -y python-lxml python-jinja2 python-netaddr python-ipaddr python-yaml + +COPY \ +{% for deb in docker_config_engine_debs.split(' ') -%} +debs/{{ deb }}{{' '}} +{%- endfor -%} +debs/ + +RUN dpkg -i \ +{% for deb in docker_config_engine_debs.split(' ') -%} +debs/{{ deb }}{{' '}} +{%- endfor %} + +## Clean up +RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y +RUN rm -rf /debs diff --git a/dockers/docker-dhcp-relay/Dockerfile.j2 b/dockers/docker-dhcp-relay/Dockerfile similarity index 59% rename from dockers/docker-dhcp-relay/Dockerfile.j2 rename to dockers/docker-dhcp-relay/Dockerfile index 85ea74a4b1..af7bdcb830 100644 --- a/dockers/docker-dhcp-relay/Dockerfile.j2 +++ b/dockers/docker-dhcp-relay/Dockerfile @@ -1,4 +1,4 @@ -FROM docker-base +FROM docker-config-engine ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive @@ -6,21 +6,6 @@ ENV DEBIAN_FRONTEND=noninteractive ## Update APT package lists RUN apt-get update -## Dependencies for sonic-cfggen -RUN apt-get -y install python-lxml python-jinja2 python-netaddr python-ipaddr python-yaml - - -COPY \ -{% for deb in docker_dhcp_relay_debs.split(' ') -%} -debs/{{ deb }}{{' '}} -{%- endfor -%} -debs/ - -RUN dpkg -i \ -{% for deb in docker_dhcp_relay_debs.split(' ') -%} -debs/{{ deb }}{{' '}} -{%- endfor %} - ## Install isc-dhcp-relay Debian package RUN apt-get -y install isc-dhcp-relay diff --git a/dockers/docker-fpm/Dockerfile.j2 b/dockers/docker-fpm/Dockerfile.j2 index ea4aa226ba..5cdbff3a06 100644 --- a/dockers/docker-fpm/Dockerfile.j2 +++ b/dockers/docker-fpm/Dockerfile.j2 @@ -1,12 +1,9 @@ -FROM docker-base +FROM docker-config-engine RUN apt-get update RUN apt-get install -y libdbus-1-3 libdaemon0 libjansson4 -# Dependencies for sonic-cfggen -RUN apt-get install -y python-lxml python-jinja2 python-netaddr python-ipaddr python-yaml - COPY \ {% for deb in docker_fpm_debs.split(' ') -%} debs/{{ deb }}{{' '}} diff --git a/dockers/docker-lldp-sv2/Dockerfile.j2 b/dockers/docker-lldp-sv2/Dockerfile.j2 index 399d2ca6e7..32d73ecf32 100644 --- a/dockers/docker-lldp-sv2/Dockerfile.j2 +++ b/dockers/docker-lldp-sv2/Dockerfile.j2 @@ -1,4 +1,4 @@ -FROM docker-base +FROM docker-config-engine COPY \ {% for deb in docker_lldp_sv2_debs.split(' ') -%} @@ -10,9 +10,6 @@ COPY python-wheels /python-wheels RUN apt-get update && apt-get install -y python-pip supervisor libbsd0 libevent-2.0-5 libjansson4 libwrap0 libxml2 libpci3 libperl5.20 -# Dependencies for sonic-cfggen -RUN apt-get install -y python-lxml python-jinja2 python-netaddr python-ipaddr python-yaml - ## Pre-install the fundamental packages ## Install Python SSWSDK ## Install LLDP Sync Daemon diff --git a/dockers/docker-orchagent/Dockerfile.j2 b/dockers/docker-orchagent/Dockerfile.j2 index f085da93a5..dd04379f57 100755 --- a/dockers/docker-orchagent/Dockerfile.j2 +++ b/dockers/docker-orchagent/Dockerfile.j2 @@ -1,4 +1,4 @@ -FROM docker-base +FROM docker-config-engine RUN apt-get update @@ -8,9 +8,6 @@ RUN apt-get install -f -y ifupdown bridge-utils libdbus-1-3 libdaemon0 libjansso ## TODO: implicitly install dependencies RUN apt-get -y install libjemalloc1 -# Dependencies for sonic-cfggen -RUN apt-get install -y python-lxml python-jinja2 python-netaddr python-ipaddr python-yaml - COPY \ {% for deb in docker_orchagent_debs.split(' ') -%} debs/{{ deb }}{{' '}} diff --git a/dockers/docker-platform-monitor/Dockerfile b/dockers/docker-platform-monitor/Dockerfile new file mode 100755 index 0000000000..0d5a5dcb45 --- /dev/null +++ b/dockers/docker-platform-monitor/Dockerfile @@ -0,0 +1,18 @@ +FROM docker-config-engine + +RUN apt-get update + +RUN apt-get install -y smartmontools sensord + +## Clean up +RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y +RUN rm -rf /debs + +COPY ["config.sh", "/usr/bin/"] + +ENTRYPOINT /usr/bin/config.sh \ + && service rsyslog start \ + && service lm-sensors start \ + && service smartmontools start \ + && service sensord start \ + && /bin/bash diff --git a/dockers/docker-platform-monitor/Dockerfile.j2 b/dockers/docker-platform-monitor/Dockerfile.j2 deleted file mode 100755 index c6020d113b..0000000000 --- a/dockers/docker-platform-monitor/Dockerfile.j2 +++ /dev/null @@ -1,33 +0,0 @@ -FROM docker-base - -RUN apt-get update - -RUN apt-get install -y smartmontools sensord - -# Dependencies for sonic-cfggen -RUN apt-get install -y python-lxml python-jinja2 python-netaddr python-ipaddr python-yaml - -COPY \ -{% for deb in docker_platform_monitor_debs.split(' ') -%} -debs/{{ deb }}{{' '}} -{%- endfor -%} -debs/ - - -RUN dpkg -i \ -{% for deb in docker_platform_monitor_debs.split(' ') -%} -debs/{{ deb }}{{' '}} -{%- endfor %} - -## Clean up -RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y -RUN rm -rf /debs - -COPY ["config.sh", "/usr/bin/"] - -ENTRYPOINT /usr/bin/config.sh \ - && service rsyslog start \ - && service lm-sensors start \ - && service smartmontools start \ - && service sensord start \ - && /bin/bash diff --git a/dockers/docker-snmp-sv2/Dockerfile.j2 b/dockers/docker-snmp-sv2/Dockerfile.j2 index f975fbf845..33a2bdaa74 100644 --- a/dockers/docker-snmp-sv2/Dockerfile.j2 +++ b/dockers/docker-snmp-sv2/Dockerfile.j2 @@ -1,4 +1,4 @@ -FROM docker-base +FROM docker-config-engine COPY \ {% for deb in docker_snmp_sv2_debs.split(' ') -%} @@ -17,9 +17,6 @@ ENV PYTHONOPTIMIZE 1 ## Clean up RUN apt-get update && apt-get install -y libmysqlclient-dev libmysqld-dev libperl-dev libpci-dev libpci3 libsensors4 libsensors4-dev libwrap0-dev -# Dependencies for sonic-cfggen -RUN apt-get install -y python-lxml python-jinja2 python-netaddr python-ipaddr python-yaml - RUN dpkg -i \ {% for deb in docker_snmp_sv2_debs.split(' ') -%} debs/{{ deb }}{{' '}} diff --git a/dockers/docker-teamd/Dockerfile.j2 b/dockers/docker-teamd/Dockerfile.j2 index e663b9d7d1..bff5ef11d4 100644 --- a/dockers/docker-teamd/Dockerfile.j2 +++ b/dockers/docker-teamd/Dockerfile.j2 @@ -1,11 +1,7 @@ -FROM docker-base +FROM docker-config-engine RUN apt-get update && apt-get install -f -y libdbus-1-3 libdaemon0 libjansson4 - -# Dependencies for sonic-cfggen -RUN apt-get install -y python-lxml python-jinja2 python-netaddr python-ipaddr python-yaml - COPY \ {% for deb in docker_teamd_debs.split(' ') -%} debs/{{ deb }}{{' '}} diff --git a/platform/broadcom/docker-orchagent-brcm.mk b/platform/broadcom/docker-orchagent-brcm.mk index f04103ef15..2278d89cb8 100644 --- a/platform/broadcom/docker-orchagent-brcm.mk +++ b/platform/broadcom/docker-orchagent-brcm.mk @@ -2,8 +2,8 @@ DOCKER_ORCHAGENT_BRCM = docker-orchagent-brcm.gz $(DOCKER_ORCHAGENT_BRCM)_PATH = $(DOCKERS_PATH)/docker-orchagent -$(DOCKER_ORCHAGENT_BRCM)_DEPENDS += $(SWSS) $(REDIS_TOOLS) $(SONIC_CONFIG_ENGINE) -$(DOCKER_ORCHAGENT_BRCM)_LOAD_DOCKERS += $(DOCKER_BASE) +$(DOCKER_ORCHAGENT_BRCM)_DEPENDS += $(SWSS) $(REDIS_TOOLS) +$(DOCKER_ORCHAGENT_BRCM)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE) SONIC_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_BRCM) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_BRCM) diff --git a/platform/cavium/docker-orchagent-cavm.mk b/platform/cavium/docker-orchagent-cavm.mk index e4ea730549..d9460d1c88 100644 --- a/platform/cavium/docker-orchagent-cavm.mk +++ b/platform/cavium/docker-orchagent-cavm.mk @@ -2,8 +2,8 @@ DOCKER_ORCHAGENT_CAVM = docker-orchagent-cavm.gz $(DOCKER_ORCHAGENT_CAVM)_PATH = $(DOCKERS_PATH)/docker-orchagent -$(DOCKER_ORCHAGENT_CAVM)_DEPENDS += $(SWSS) $(REDIS_TOOLS) $(SONIC_CONFIG_ENGINE) -$(DOCKER_ORCHAGENT_CAVM)_LOAD_DOCKERS += $(DOCKER_BASE) +$(DOCKER_ORCHAGENT_CAVM)_DEPENDS += $(SWSS) $(REDIS_TOOLS) +$(DOCKER_ORCHAGENT_CAVM)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE) SONIC_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_CAVM) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_CAVM) diff --git a/platform/mellanox/docker-orchagent-mlnx.mk b/platform/mellanox/docker-orchagent-mlnx.mk index 5b526cc6f3..c193a77541 100644 --- a/platform/mellanox/docker-orchagent-mlnx.mk +++ b/platform/mellanox/docker-orchagent-mlnx.mk @@ -2,8 +2,8 @@ DOCKER_ORCHAGENT_MLNX = docker-orchagent-mlnx.gz $(DOCKER_ORCHAGENT_MLNX)_PATH = $(DOCKERS_PATH)/docker-orchagent -$(DOCKER_ORCHAGENT_MLNX)_DEPENDS += $(SWSS) $(REDIS_TOOLS) $(SONIC_CONFIG_ENGINE) -$(DOCKER_ORCHAGENT_MLNX)_LOAD_DOCKERS += $(DOCKER_BASE) +$(DOCKER_ORCHAGENT_MLNX)_DEPENDS += $(SWSS) $(REDIS_TOOLS) +$(DOCKER_ORCHAGENT_MLNX)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE) SONIC_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_MLNX) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_MLNX) diff --git a/rules/docker-config-engine.mk b/rules/docker-config-engine.mk new file mode 100644 index 0000000000..8f168cc441 --- /dev/null +++ b/rules/docker-config-engine.mk @@ -0,0 +1,7 @@ +# docker image for sonic config engine + +DOCKER_CONFIG_ENGINE = docker-config-engine.gz +$(DOCKER_CONFIG_ENGINE)_PATH = $(DOCKERS_PATH)/docker-config-engine +$(DOCKER_CONFIG_ENGINE)_DEPENDS += $(SONIC_CONFIG_ENGINE) +$(DOCKER_CONFIG_ENGINE)_LOAD_DOCKERS += $(DOCKER_BASE) +SONIC_DOCKER_IMAGES += $(DOCKER_CONFIG_ENGINE) diff --git a/rules/docker-dhcp-relay.mk b/rules/docker-dhcp-relay.mk index c0d88e595f..7a7a1afeb4 100644 --- a/rules/docker-dhcp-relay.mk +++ b/rules/docker-dhcp-relay.mk @@ -2,9 +2,8 @@ DOCKER_DHCP_RELAY = docker-dhcp-relay.gz $(DOCKER_DHCP_RELAY)_PATH = $(DOCKERS_PATH)/docker-dhcp-relay -$(DOCKER_DHCP_RELAY)_DEPENDS += $(SONIC_CONFIG_ENGINE) -$(DOCKER_DHCP_RELAY)_LOAD_DOCKERS = $(DOCKER_BASE) -SONIC_DOCKER_IMAGES += $(DOCKER_DHCP_RELAY) +$(DOCKER_DHCP_RELAY)_LOAD_DOCKERS = $(DOCKER_CONFIG_ENGINE) +SONIC_SIMPLE_DOCKER_IMAGES += $(DOCKER_DHCP_RELAY) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_DHCP_RELAY) diff --git a/rules/docker-fpm.mk b/rules/docker-fpm.mk index 4c9c09ffd4..d7f4d96005 100644 --- a/rules/docker-fpm.mk +++ b/rules/docker-fpm.mk @@ -2,8 +2,8 @@ DOCKER_FPM = docker-fpm.gz $(DOCKER_FPM)_PATH = $(DOCKERS_PATH)/docker-fpm -$(DOCKER_FPM)_DEPENDS += $(QUAGGA) $(SWSS) $(SONIC_CONFIG_ENGINE) -$(DOCKER_FPM)_LOAD_DOCKERS += $(DOCKER_BASE) +$(DOCKER_FPM)_DEPENDS += $(QUAGGA) $(SWSS) +$(DOCKER_FPM)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE) SONIC_DOCKER_IMAGES += $(DOCKER_FPM) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_FPM) diff --git a/rules/docker-lldp-sv2.mk b/rules/docker-lldp-sv2.mk index e9f701a495..d9500d1d07 100644 --- a/rules/docker-lldp-sv2.mk +++ b/rules/docker-lldp-sv2.mk @@ -2,9 +2,9 @@ DOCKER_LLDP_SV2 = docker-lldp-sv2.gz $(DOCKER_LLDP_SV2)_PATH = $(DOCKERS_PATH)/docker-lldp-sv2 -$(DOCKER_LLDP_SV2)_DEPENDS += $(LLDPD) $(SONIC_CONFIG_ENGINE) +$(DOCKER_LLDP_SV2)_DEPENDS += $(LLDPD) $(DOCKER_LLDP_SV2)_PYTHON_WHEELS += $(DBSYNCD_PY2) -$(DOCKER_LLDP_SV2)_LOAD_DOCKERS += $(DOCKER_BASE) +$(DOCKER_LLDP_SV2)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE) SONIC_DOCKER_IMAGES += $(DOCKER_LLDP_SV2) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_LLDP_SV2) diff --git a/rules/docker-platform-monitor.mk b/rules/docker-platform-monitor.mk index 92b64bf15b..09bec7125c 100644 --- a/rules/docker-platform-monitor.mk +++ b/rules/docker-platform-monitor.mk @@ -2,10 +2,9 @@ DOCKER_PLATFORM_MONITOR = docker-platform-monitor.gz $(DOCKER_PLATFORM_MONITOR)_PATH = $(DOCKERS_PATH)/docker-platform-monitor -$(DOCKER_PLATFORM_MONITOR)_DEPENDS += $(SONIC_CONFIG_ENGINE) -$(DOCKER_PLATFORM_MONITOR)_LOAD_DOCKERS = $(DOCKER_BASE) +$(DOCKER_PLATFORM_MONITOR)_LOAD_DOCKERS = $(DOCKER_CONFIG_ENGINE) -SONIC_DOCKER_IMAGES += $(DOCKER_PLATFORM_MONITOR) +SONIC_SIMPLE_DOCKER_IMAGES += $(DOCKER_PLATFORM_MONITOR) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_PLATFORM_MONITOR) $(DOCKER_PLATFORM_MONITOR)_CONTAINER_NAME = pmon diff --git a/rules/docker-snmp-sv2.mk b/rules/docker-snmp-sv2.mk index e3ed0cf1ea..0cad7cb434 100644 --- a/rules/docker-snmp-sv2.mk +++ b/rules/docker-snmp-sv2.mk @@ -2,9 +2,9 @@ DOCKER_SNMP_SV2 = docker-snmp-sv2.gz $(DOCKER_SNMP_SV2)_PATH = $(DOCKERS_PATH)/docker-snmp-sv2 -$(DOCKER_SNMP_SV2)_DEPENDS += $(SNMP) $(SNMPD) $(SONIC_CONFIG_ENGINE) +$(DOCKER_SNMP_SV2)_DEPENDS += $(SNMP) $(SNMPD) $(DOCKER_SNMP_SV2)_PYTHON_WHEELS += $(ASYNCSNMP_PY3) -$(DOCKER_SNMP_SV2)_LOAD_DOCKERS += $(DOCKER_BASE) +$(DOCKER_SNMP_SV2)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE) SONIC_DOCKER_IMAGES += $(DOCKER_SNMP_SV2) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SNMP_SV2) diff --git a/rules/docker-teamd.mk b/rules/docker-teamd.mk index ec242589b2..f023c3598f 100644 --- a/rules/docker-teamd.mk +++ b/rules/docker-teamd.mk @@ -2,8 +2,8 @@ DOCKER_TEAMD = docker-teamd.gz $(DOCKER_TEAMD)_PATH = $(DOCKERS_PATH)/docker-teamd -$(DOCKER_TEAMD)_DEPENDS += $(SWSS) $(LIBTEAMDCT) $(LIBTEAM_UTILS) $(SONIC_CONFIG_ENGINE) -$(DOCKER_TEAMD)_LOAD_DOCKERS += $(DOCKER_BASE) +$(DOCKER_TEAMD)_DEPENDS += $(SWSS) $(LIBTEAMDCT) $(LIBTEAM_UTILS) +$(DOCKER_TEAMD)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE) SONIC_DOCKER_IMAGES += $(DOCKER_TEAMD) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_TEAMD)