Added caching / avoid orphans mechanisms

This commit is contained in:
Alexey Pustovalov
2024-02-18 23:27:03 +09:00
parent d197c8ccd3
commit 2d1df585ef
62 changed files with 186 additions and 206 deletions

View File

@ -100,8 +100,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/php81/ && \
chgrp -R 0 /etc/apache2/ /etc/php81/ && \
chmod -R g=u /etc/apache2/ /etc/php81/ && \
rm -rf /var/cache/apk/*
chmod -R g=u /etc/apache2/ /etc/php81/
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 && \
INSTALL_PKGS="bash \
curl-minimal \
httpd \
@ -117,9 +118,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

@ -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-ol9.repo", "/etc/yum.repos.d/oracle-epel-ol9.repo"]
RUN set -eux && \
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
set -eux && \
INSTALL_PKGS="bash \
curl \
httpd \
@ -54,6 +55,7 @@ RUN set -eux && \
--enablerepo="ol9_appstream" \
--enablerepo="ol9_developer_EPEL" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
--best \
--nodocs \
${INSTALL_PKGS} && \
@ -103,9 +105,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