Skip to content

Commit

Permalink
Updated CentOS 8 to CentOS 9
Browse files Browse the repository at this point in the history
  • Loading branch information
dotneft committed Dec 3, 2024
1 parent d598feb commit 604c81f
Show file tree
Hide file tree
Showing 16 changed files with 335 additions and 319 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
44 changes: 23 additions & 21 deletions Dockerfiles/agent/centos/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -32,36 +32,38 @@ 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 \
pcre2 \
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 \
Expand All @@ -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

Expand Down
42 changes: 22 additions & 20 deletions Dockerfiles/agent2/centos/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand All @@ -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

Expand Down
40 changes: 21 additions & 19 deletions Dockerfiles/build-base/centos/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -19,7 +19,6 @@ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zab

RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
set -eux && \
REPOLIST="baseos,appstream,powertools,epel" && \
INSTALL_PKGS="autoconf \
automake \
bash \
Expand Down Expand Up @@ -47,24 +46,27 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
go-toolset \
unixODBC-devel \
zlib-devel" && \
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 \
--enablerepo "extras-common" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
--best \
--nodocs epel-release && \
microdnf -y module enable \
--disablerepo "*" \
--enablerepo "appstream" \
--setopt=install_weak_deps=False \
--setopt=keepcache=False \
postgresql:16 mysql && \
dnf -y install \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
postgresql:16 && \
microdnf -y install \
--disablerepo "*" \
--enablerepo "${REPOLIST}" \
--setopt=tsflags=nodocs \
--setopt=install_weak_deps=False \
--setopt=keepcache=False \
--best ${INSTALL_PKGS} && \
dnf -y clean all
--enablerepo "baseos" \
--enablerepo "appstream" \
--enablerepo "crb" \
--enablerepo="epel" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
--best \
--nodocs ${INSTALL_PKGS} && \
microdnf -y clean all
19 changes: 10 additions & 9 deletions Dockerfiles/java-gateway/centos/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -30,17 +30,18 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/java_gateway/sbin/", "/u

RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
set -eux && \
REPOLIST="baseos,appstream" && \
INSTALL_PKGS="bash \
shadow-utils \
java-17-openjdk-headless \
findutils" && \
dnf -y install \
microdnf -y install \
--disablerepo "*" \
--enablerepo "${REPOLIST}" \
--setopt=tsflags=nodocs \
--setopt=install_weak_deps=False \
--setopt=keepcache=False \
--best ${INSTALL_PKGS} && \
--enablerepo "baseos" \
--enablerepo "appstream" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
--best \
--nodocs ${INSTALL_PKGS} && \
groupadd \
--system \
--gid 1995 \
Expand All @@ -61,7 +62,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
chown --quiet -R zabbix:root /etc/zabbix/ /usr/sbin/zabbix_java/ && \
chgrp -R 0 /etc/zabbix/ /usr/sbin/zabbix_java/ && \
chmod -R g=u /etc/zabbix/ /usr/sbin/zabbix_java/ && \
dnf -y clean all
microdnf -y clean all

EXPOSE 10052/TCP

Expand Down
52 changes: 24 additions & 28 deletions Dockerfiles/proxy-mysql/centos/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -35,7 +35,6 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/proxy/database/mysql/",

RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
set -eux && \
REPOLIST="baseos,appstream,epel" && \
INSTALL_PKGS="libevent \
tini \
traceroute \
Expand All @@ -52,36 +51,33 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
openldap \
openssl-libs \
pcre2 \
shadow-utils \
zlib \
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 && \
groupadd \
--system \
--gid 1995 \
Expand Down Expand Up @@ -113,7 +109,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

Expand Down
Loading

0 comments on commit 604c81f

Please sign in to comment.