Use Centos 9 minimal instead of full image

This commit is contained in:
Alexey Pustovalov
2024-02-18 20:52:36 +09:00
parent 3e554a344e
commit d76647c026
14 changed files with 290 additions and 162 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:stream9
FROM quay.io/centos/centos:stream9-minimal
ARG MAJOR_VERSION
ARG ZBX_VERSION
@ -30,7 +30,6 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/ui", "/usr/share/zabbix"]
COPY ["conf/etc/", "/etc/"]
RUN set -eux && \
REPOLIST="baseos,appstream,epel" && \
INSTALL_PKGS="bash \
curl-minimal \
httpd \
@ -47,15 +46,31 @@ RUN set -eux && \
php-xml \
findutils \
glibc-locale-source \
shadow-utils \
supervisor" && \
dnf -y install epel-release && \
dnf -y install \
--disablerepo "*" \
--enablerepo "${REPOLIST}" \
--setopt=tsflags=nodocs \
--setopt=install_weak_deps=False \
microdnf -y install \
--disablerepo "*" \
--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 \
${INSTALL_PKGS} && \
--setopt=tsflags=nodocs \
tzdata && \
groupadd \
--system \
--gid 1995 \
@ -99,10 +114,10 @@ RUN set -eux && \
chown --quiet -R zabbix:root /run/httpd/ /var/lib/php/session/ && \
chgrp -R 0 /run/httpd/ /var/lib/php/session/ && \
chmod -R g=u /run/httpd/ /var/lib/php/session/ && \
dnf -y remove \
microdnf -y remove \
findutils \
glibc-locale-source && \
dnf -y clean all && \
microdnf -y clean all && \
rm -rf /var/cache/yum /var/lib/yum/yumdb/* /usr/lib/udev/hwdb.d/* && \
rm -rf /var/cache/dnf /etc/udev/hwdb.bin /root/.pki