Added caching / avoid orphans mechanisms

This commit is contained in:
Alexey Pustovalov
2024-02-18 23:27:03 +09:00
parent 966ae54854
commit ee74bf931e
62 changed files with 187 additions and 206 deletions

View File

@ -99,8 +99,7 @@ RUN set -eux && \
chmod -R g=u /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chown --quiet -R zabbix:root /etc/apache2/ /etc/php8/ && \
chgrp -R 0 /etc/apache2/ /etc/php8/ && \
chmod -R g=u /etc/apache2/ /etc/php8/ && \
rm -rf /var/cache/apk/*
chmod -R g=u /etc/apache2/ /etc/php8/
EXPOSE 8080/TCP 8443/TCP

View File

@ -29,7 +29,8 @@ STOPSIGNAL SIGTERM
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/ui", "/usr/share/zabbix"]
COPY ["conf/etc/", "/etc/"]
RUN set -eux && \
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
set -eux && \
REPOLIST="baseos,appstream,epel" && \
INSTALL_PKGS="bash \
curl \
@ -55,6 +56,7 @@ RUN set -eux && \
--enablerepo "${REPOLIST}" \
--setopt=tsflags=nodocs \
--setopt=install_weak_deps=False \
--setopt=keepcache=0 \
--best \
${INSTALL_PKGS} && \
groupadd \
@ -103,9 +105,7 @@ RUN set -eux && \
dnf -y remove \
findutils \
glibc-locale-source && \
dnf -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
dnf -y clean all
EXPOSE 8080/TCP 8443/TCP

View File

@ -30,7 +30,8 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/ui", "/usr/share/zabbix"]
COPY ["conf/etc/", "/etc/"]
COPY ["conf/etc/yum.repos.d/oracle-epel-ol8.repo", "/etc/yum.repos.d/oracle-epel-ol8.repo"]
RUN set -eux && \
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
set -eux && \
INSTALL_PKGS="bash \
curl \
httpd \
@ -56,6 +57,7 @@ RUN set -eux && \
--enablerepo="ol8_appstream" \
--enablerepo="ol8_developer_EPEL" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
--best \
--nodocs \
${INSTALL_PKGS} && \
@ -105,9 +107,7 @@ RUN set -eux && \
microdnf -y remove \
findutils \
glibc-locale-source && \
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
microdnf -y clean all
EXPOSE 8080/TCP 8443/TCP

View File

@ -29,7 +29,8 @@ STOPSIGNAL SIGTERM
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/ui", "/usr/share/zabbix"]
COPY ["conf/etc/", "/etc/"]
RUN set -eux && \
RUN --mount=type=cache,target=/var/lib/apt/,sharing=locked \
set -eux && \
echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d && \
INSTALL_PKGS="bash \
apache2 \
@ -100,8 +101,7 @@ RUN set -eux && \
chgrp -R 0 /etc/apache2/ /etc/php/8.1/ && \
chmod -R g=u /etc/apache2/ /etc/php/8.1/ && \
apt-get -y autoremove && \
apt-get -y clean && \
rm -rf /var/lib/apt/lists/*
apt-get -y clean
EXPOSE 8080/TCP 8443/TCP