Updated CentOS 8 to CentOS 9

This commit is contained in:
Alexey Pustovalov
2024-12-03 18:04:04 +09:00
parent d598feb719
commit 604c81fac2
16 changed files with 335 additions and 319 deletions

View File

@ -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
@ -35,17 +35,19 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/server/database/mysql/cr
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
set -eux && \
REPOLIST="baseos,appstream,epel" && \
INSTALL_PKGS="fping \
tini \
traceroute \
nmap \
hostname \
file-libs \
iputils \
traceroute \
libevent \
libxml2 \
libssh \
libpsl \
libbrotli \
libxml2 \
mysql \
mysql-libs \
net-snmp-libs \
@ -53,37 +55,38 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
openldap \
openssl-libs \
pcre2 \
shadow-utils \
zlib \
gzip \
unixODBC" && \
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 module enable \
--disablerepo "*" \
--enablerepo "appstream" \
--setopt=tsflags=nodocs \
--setopt=install_weak_deps=False \
--setopt=keepcache=False \
mysql && \
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 "crb" \
--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 && \
microdnf download libcurl && \
rpm -Uvh --nodeps --replacefiles "*curl*$( uname -i ).rpm" && \
microdnf remove -y libcurl-minimal && \
rm -rf "*curl*$( uname -i ).rpm" && \
groupadd \
--system \
--gid 1995 \
@ -119,7 +122,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 10051/TCP