diff --git a/.env b/.env index da42d6b88..353101311 100644 --- a/.env +++ b/.env @@ -70,7 +70,7 @@ RESTART_POLICY=unless-stopped # Cache base images ALPINE_CACHE_FROM=alpine:3.19 -CENTOS_CACHE_FROM=quay.io/centos/centos:stream8 +CENTOS_CACHE_FROM=quay.io/centos/centos:stream9-slim OL_CACHE_FROM=oraclelinux:8-slim UBUNTU_CACHE_FROM=ubuntu:jammy RHEL_CACHE_FROM=registry.access.redhat.com/ubi8/ubi-minimal:8.10 diff --git a/Dockerfiles/agent/centos/Dockerfile b/Dockerfiles/agent/centos/Dockerfile index 28c1252cd..cd0039997 100644 --- a/Dockerfiles/agent/centos/Dockerfile +++ b/Dockerfiles/agent/centos/Dockerfile @@ -5,7 +5,7 @@ ARG BUILD_BASE_IMAGE=zabbix-build-mysql:centos-${ZBX_VERSION} FROM ${BUILD_BASE_IMAGE} AS builder -FROM quay.io/centos/centos:stream8 +FROM quay.io/centos/centos:stream9-minimal ARG MAJOR_VERSION ARG ZBX_VERSION @@ -32,7 +32,6 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent/conf/", "/etc/zabb RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ set -eux && \ - REPOLIST="baseos,appstream,epel" && \ INSTALL_PKGS="bash \ tini \ iputils \ @@ -40,28 +39,31 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ libcurl-minimal \ libmodbus \ openssl-libs \ + shadow-utils \ zlib" && \ - dnf -y install \ + microdnf -y install \ --disablerepo "*" \ - --enablerepo "extras" \ - --setopt=tsflags=nodocs \ - --setopt=install_weak_deps=False \ - --setopt=keepcache=False \ - --best epel-release && \ - dnf -y install \ - --disablerepo "*" \ - --enablerepo "${REPOLIST}" \ - --setopt=tsflags=nodocs \ - --setopt=install_weak_deps=False \ - --setopt=keepcache=False \ - --best ${INSTALL_PKGS} && \ - dnf -y reinstall \ + --enablerepo "extras-common" \ + --setopt=install_weak_deps=0 \ + --setopt=keepcache=0 \ + --best \ + --nodocs epel-release && \ + microdnf -y install \ --disablerepo "*" \ --enablerepo "baseos" \ - --setopt=tsflags=nodocs \ - --setopt=install_weak_deps=False \ - --setopt=keepcache=False \ - --best tzdata && \ + --enablerepo "appstream" \ + --enablerepo="epel" \ + --setopt=install_weak_deps=0 \ + --setopt=keepcache=0 \ + --best \ + --nodocs ${INSTALL_PKGS} && \ + microdnf -y reinstall \ + --enablerepo "baseos" \ + --setopt=install_weak_deps=0 \ + --setopt=keepcache=0 \ + --best \ + --setopt=tsflags=nodocs \ + tzdata && \ groupadd \ --system \ --gid 1995 \ @@ -82,7 +84,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ chown --quiet -R zabbix:root /etc/zabbix/ /var/lib/zabbix/ && \ chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ && \ chmod -R g=u /etc/zabbix/ /var/lib/zabbix/ && \ - dnf -y clean all + microdnf -y clean all EXPOSE 10050/TCP diff --git a/Dockerfiles/agent2/centos/Dockerfile b/Dockerfiles/agent2/centos/Dockerfile index 7b948fc14..a2ce5dd78 100644 --- a/Dockerfiles/agent2/centos/Dockerfile +++ b/Dockerfiles/agent2/centos/Dockerfile @@ -5,7 +5,7 @@ ARG BUILD_BASE_IMAGE=zabbix-build-mysql:centos-${ZBX_VERSION} FROM ${BUILD_BASE_IMAGE} AS builder -FROM quay.io/centos/centos:stream8 +FROM quay.io/centos/centos:stream9-minimal ARG MAJOR_VERSION ARG ZBX_VERSION @@ -32,36 +32,38 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent2/conf/", "/etc/zab RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ set -eux && \ - REPOLIST="baseos,appstream,epel" && \ INSTALL_PKGS="bash \ tini \ iputils \ pcre2 \ libcurl-minimal \ smartmontools \ + shadow-utils \ sudo \ openssl-libs" && \ - dnf -y install \ + microdnf -y install \ --disablerepo "*" \ - --enablerepo "extras" \ - --setopt=tsflags=nodocs \ - --setopt=install_weak_deps=False \ - --setopt=keepcache=False \ - --best epel-release && \ - dnf -y install \ - --disablerepo "*" \ - --enablerepo "${REPOLIST}" \ - --setopt=tsflags=nodocs \ - --setopt=install_weak_deps=False \ - --setopt=keepcache=False \ - --best ${INSTALL_PKGS} && \ - dnf -y reinstall \ + --enablerepo "extras-common" \ + --setopt=install_weak_deps=0 \ + --setopt=keepcache=0 \ + --best \ + --nodocs epel-release && \ + microdnf -y install \ --disablerepo "*" \ --enablerepo "baseos" \ + --enablerepo "appstream" \ + --enablerepo="epel" \ + --setopt=install_weak_deps=0 \ + --setopt=keepcache=0 \ + --best \ + --nodocs ${INSTALL_PKGS} && \ + microdnf -y reinstall \ + --enablerepo "baseos" \ + --setopt=install_weak_deps=0 \ + --setopt=keepcache=0 \ + --best \ --setopt=tsflags=nodocs \ - --setopt=install_weak_deps=False \ - --setopt=keepcache=False \ - --best tzdata && \ + tzdata && \ groupadd \ --system \ --gid 1995 \ @@ -85,7 +87,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ chown --quiet -R zabbix:root /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/ && \ chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/ && \ chmod -R g=u /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/ && \ - dnf -y clean all + microdnf -y clean all EXPOSE 10050/TCP 31999/TCP diff --git a/Dockerfiles/build-base/centos/Dockerfile b/Dockerfiles/build-base/centos/Dockerfile index 4edb2b894..4ab74ea13 100644 --- a/Dockerfiles/build-base/centos/Dockerfile +++ b/Dockerfiles/build-base/centos/Dockerfile @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:1 -FROM quay.io/centos/centos:stream8 +FROM quay.io/centos/centos:stream9-minimal ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION}.36 @@ -19,7 +19,6 @@ LABEL org.opencontainers.image.authors="Alexey Pustovalov