From 9ed71c8c52b6dd72c76cbca15b8ad85ae5cf3c8d Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Tue, 15 Jul 2025 18:04:47 +0900 Subject: [PATCH] Removed orphaned *.pyc files from Ubuntu images --- Dockerfiles/web-apache-mysql/alpine/Dockerfile | 1 - Dockerfiles/web-apache-mysql/centos/Dockerfile | 1 - Dockerfiles/web-apache-mysql/ol/Dockerfile | 1 - Dockerfiles/web-apache-mysql/ubuntu/Dockerfile | 3 ++- Dockerfiles/web-apache-pgsql/alpine/Dockerfile | 1 - Dockerfiles/web-apache-pgsql/centos/Dockerfile | 1 - Dockerfiles/web-apache-pgsql/ol/Dockerfile | 1 - Dockerfiles/web-apache-pgsql/ubuntu/Dockerfile | 3 ++- Dockerfiles/web-nginx-mysql/alpine/Dockerfile | 1 - Dockerfiles/web-nginx-mysql/centos/Dockerfile | 1 - Dockerfiles/web-nginx-mysql/ol/Dockerfile | 1 - Dockerfiles/web-nginx-mysql/rhel/Dockerfile | 1 - Dockerfiles/web-nginx-mysql/ubuntu/Dockerfile | 3 ++- Dockerfiles/web-nginx-pgsql/alpine/Dockerfile | 1 - Dockerfiles/web-nginx-pgsql/centos/Dockerfile | 1 - Dockerfiles/web-nginx-pgsql/ol/Dockerfile | 1 - Dockerfiles/web-nginx-pgsql/rhel/Dockerfile | 1 - Dockerfiles/web-nginx-pgsql/ubuntu/Dockerfile | 3 ++- 18 files changed, 8 insertions(+), 18 deletions(-) diff --git a/Dockerfiles/web-apache-mysql/alpine/Dockerfile b/Dockerfiles/web-apache-mysql/alpine/Dockerfile index 4c5d32ef9..c81110368 100644 --- a/Dockerfiles/web-apache-mysql/alpine/Dockerfile +++ b/Dockerfiles/web-apache-mysql/alpine/Dockerfile @@ -98,7 +98,6 @@ RUN set -eux && \ cd ${ZABBIX_WWW_ROOT}/ && \ rm -f conf/zabbix.conf.php conf/maintenance.inc.php conf/zabbix.conf.php.example && \ rm -rf tests && \ - rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.po' | xargs rm -f && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.sh' | xargs rm -f && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "${ZABBIX_WWW_ROOT}/conf/zabbix.conf.php" && \ diff --git a/Dockerfiles/web-apache-mysql/centos/Dockerfile b/Dockerfiles/web-apache-mysql/centos/Dockerfile index 026b0ca12..a5273da0f 100644 --- a/Dockerfiles/web-apache-mysql/centos/Dockerfile +++ b/Dockerfiles/web-apache-mysql/centos/Dockerfile @@ -107,7 +107,6 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ cd ${ZABBIX_WWW_ROOT}/ && \ rm -f conf/zabbix.conf.php conf/maintenance.inc.php conf/zabbix.conf.php.example && \ rm -rf tests && \ - rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.po' | xargs rm -f && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.sh' | xargs rm -f && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "${ZABBIX_WWW_ROOT}/conf/zabbix.conf.php" && \ diff --git a/Dockerfiles/web-apache-mysql/ol/Dockerfile b/Dockerfiles/web-apache-mysql/ol/Dockerfile index 337bda874..6f2ee9759 100644 --- a/Dockerfiles/web-apache-mysql/ol/Dockerfile +++ b/Dockerfiles/web-apache-mysql/ol/Dockerfile @@ -94,7 +94,6 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ cd ${ZABBIX_WWW_ROOT}/ && \ rm -f conf/zabbix.conf.php conf/maintenance.inc.php conf/zabbix.conf.php.example && \ rm -rf tests && \ - rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.po' | xargs rm -f && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.sh' | xargs rm -f && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "${ZABBIX_WWW_ROOT}/conf/zabbix.conf.php" && \ diff --git a/Dockerfiles/web-apache-mysql/ubuntu/Dockerfile b/Dockerfiles/web-apache-mysql/ubuntu/Dockerfile index 585be1568..3014a3ed0 100644 --- a/Dockerfiles/web-apache-mysql/ubuntu/Dockerfile +++ b/Dockerfiles/web-apache-mysql/ubuntu/Dockerfile @@ -37,6 +37,7 @@ RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \ --mount=type=cache,target=/var/lib/apt/,sharing=locked \ set -eux && \ echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d && \ + export PYTHONDONTWRITEBYTECODE=1 && \ INSTALL_PKGS="bash \ tzdata \ curl \ @@ -87,7 +88,7 @@ RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \ cd ${ZABBIX_WWW_ROOT}/ && \ rm -f conf/zabbix.conf.php conf/maintenance.inc.php conf/zabbix.conf.php.example && \ rm -rf tests && \ - rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ + find /usr -name '*.pyc' -type f -exec bash -c 'for pyc_file; do dpkg -S "$pyc_file" &> /dev/null || rm -f "$pyc_file"; done' -- '{}' + && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.po' | xargs rm -f && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.sh' | xargs rm -f && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "${ZABBIX_WWW_ROOT}/conf/zabbix.conf.php" && \ diff --git a/Dockerfiles/web-apache-pgsql/alpine/Dockerfile b/Dockerfiles/web-apache-pgsql/alpine/Dockerfile index afa8bae70..c63c0c583 100644 --- a/Dockerfiles/web-apache-pgsql/alpine/Dockerfile +++ b/Dockerfiles/web-apache-pgsql/alpine/Dockerfile @@ -97,7 +97,6 @@ RUN set -eux && \ cd ${ZABBIX_WWW_ROOT}/ && \ rm -f conf/zabbix.conf.php conf/maintenance.inc.php conf/zabbix.conf.php.example && \ rm -rf tests && \ - rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.po' | xargs rm -f && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.sh' | xargs rm -f && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "${ZABBIX_WWW_ROOT}/conf/zabbix.conf.php" && \ diff --git a/Dockerfiles/web-apache-pgsql/centos/Dockerfile b/Dockerfiles/web-apache-pgsql/centos/Dockerfile index 791afb593..ccbfadb38 100644 --- a/Dockerfiles/web-apache-pgsql/centos/Dockerfile +++ b/Dockerfiles/web-apache-pgsql/centos/Dockerfile @@ -107,7 +107,6 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ cd ${ZABBIX_WWW_ROOT}/ && \ rm -f conf/zabbix.conf.php conf/maintenance.inc.php conf/zabbix.conf.php.example && \ rm -rf tests && \ - rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.po' | xargs rm -f && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.sh' | xargs rm -f && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "${ZABBIX_WWW_ROOT}/conf/zabbix.conf.php" && \ diff --git a/Dockerfiles/web-apache-pgsql/ol/Dockerfile b/Dockerfiles/web-apache-pgsql/ol/Dockerfile index c2c8bab50..51d329e71 100644 --- a/Dockerfiles/web-apache-pgsql/ol/Dockerfile +++ b/Dockerfiles/web-apache-pgsql/ol/Dockerfile @@ -94,7 +94,6 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ cd ${ZABBIX_WWW_ROOT}/ && \ rm -f conf/zabbix.conf.php conf/maintenance.inc.php conf/zabbix.conf.php.example && \ rm -rf tests && \ - rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.po' | xargs rm -f && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.sh' | xargs rm -f && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "${ZABBIX_WWW_ROOT}/conf/zabbix.conf.php" && \ diff --git a/Dockerfiles/web-apache-pgsql/ubuntu/Dockerfile b/Dockerfiles/web-apache-pgsql/ubuntu/Dockerfile index 66bc85069..713f57f0e 100644 --- a/Dockerfiles/web-apache-pgsql/ubuntu/Dockerfile +++ b/Dockerfiles/web-apache-pgsql/ubuntu/Dockerfile @@ -37,6 +37,7 @@ RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \ --mount=type=cache,target=/var/lib/apt/,sharing=locked \ set -eux && \ echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d && \ + export PYTHONDONTWRITEBYTECODE=1 && \ INSTALL_PKGS="bash \ tzdata \ curl \ @@ -105,7 +106,7 @@ RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \ cd ${ZABBIX_WWW_ROOT}/ && \ rm -f conf/zabbix.conf.php conf/maintenance.inc.php conf/zabbix.conf.php.example && \ rm -rf tests && \ - rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ + find /usr -name '*.pyc' -type f -exec bash -c 'for pyc_file; do dpkg -S "$pyc_file" &> /dev/null || rm -f "$pyc_file"; done' -- '{}' + && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.po' | xargs rm -f && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.sh' | xargs rm -f && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "${ZABBIX_WWW_ROOT}/conf/zabbix.conf.php" && \ diff --git a/Dockerfiles/web-nginx-mysql/alpine/Dockerfile b/Dockerfiles/web-nginx-mysql/alpine/Dockerfile index a5dd9d562..49c3c2f4d 100644 --- a/Dockerfiles/web-nginx-mysql/alpine/Dockerfile +++ b/Dockerfiles/web-nginx-mysql/alpine/Dockerfile @@ -93,7 +93,6 @@ RUN set -eux && \ cd ${ZABBIX_WWW_ROOT}/ && \ rm -f conf/zabbix.conf.php conf/maintenance.inc.php conf/zabbix.conf.php.example && \ rm -rf tests && \ - rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.po' | xargs rm -f && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.sh' | xargs rm -f && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "${ZABBIX_WWW_ROOT}/conf/zabbix.conf.php" && \ diff --git a/Dockerfiles/web-nginx-mysql/centos/Dockerfile b/Dockerfiles/web-nginx-mysql/centos/Dockerfile index 02af022a5..aafdb79e5 100644 --- a/Dockerfiles/web-nginx-mysql/centos/Dockerfile +++ b/Dockerfiles/web-nginx-mysql/centos/Dockerfile @@ -102,7 +102,6 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ cd ${ZABBIX_WWW_ROOT}/ && \ rm -f conf/zabbix.conf.php conf/maintenance.inc.php conf/zabbix.conf.php.example && \ rm -rf tests && \ - rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.po' | xargs rm -f && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.sh' | xargs rm -f && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "${ZABBIX_WWW_ROOT}/conf/zabbix.conf.php" && \ diff --git a/Dockerfiles/web-nginx-mysql/ol/Dockerfile b/Dockerfiles/web-nginx-mysql/ol/Dockerfile index c6c1ce6eb..d48ece742 100644 --- a/Dockerfiles/web-nginx-mysql/ol/Dockerfile +++ b/Dockerfiles/web-nginx-mysql/ol/Dockerfile @@ -89,7 +89,6 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ cd ${ZABBIX_WWW_ROOT}/ && \ rm -f conf/zabbix.conf.php conf/maintenance.inc.php conf/zabbix.conf.php.example && \ rm -rf tests && \ - rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.po' | xargs rm -f && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.sh' | xargs rm -f && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "${ZABBIX_WWW_ROOT}/conf/zabbix.conf.php" && \ diff --git a/Dockerfiles/web-nginx-mysql/rhel/Dockerfile b/Dockerfiles/web-nginx-mysql/rhel/Dockerfile index d55ead00f..ac7adcd6a 100644 --- a/Dockerfiles/web-nginx-mysql/rhel/Dockerfile +++ b/Dockerfiles/web-nginx-mysql/rhel/Dockerfile @@ -133,7 +133,6 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ cd ${ZABBIX_WWW_ROOT}/ && \ rm -f conf/zabbix.conf.php conf/maintenance.inc.php conf/zabbix.conf.php.example && \ rm -rf tests && \ - rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.po' | xargs rm -f && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.sh' | xargs rm -f && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "${ZABBIX_WWW_ROOT}/conf/zabbix.conf.php" && \ diff --git a/Dockerfiles/web-nginx-mysql/ubuntu/Dockerfile b/Dockerfiles/web-nginx-mysql/ubuntu/Dockerfile index 554c804fc..f68a6db7c 100644 --- a/Dockerfiles/web-nginx-mysql/ubuntu/Dockerfile +++ b/Dockerfiles/web-nginx-mysql/ubuntu/Dockerfile @@ -37,6 +37,7 @@ RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \ --mount=type=cache,target=/var/lib/apt/,sharing=locked \ set -eux && \ echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d && \ + export PYTHONDONTWRITEBYTECODE=1 && \ INSTALL_PKGS="bash \ tzdata \ ca-certificates \ @@ -87,7 +88,7 @@ RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \ cd ${ZABBIX_WWW_ROOT}/ && \ rm -f conf/zabbix.conf.php conf/maintenance.inc.php conf/zabbix.conf.php.example && \ rm -rf tests && \ - rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ + find /usr -name '*.pyc' -type f -exec bash -c 'for pyc_file; do dpkg -S "$pyc_file" &> /dev/null || rm -f "$pyc_file"; done' -- '{}' + && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.po' | xargs rm -f && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.sh' | xargs rm -f && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "${ZABBIX_WWW_ROOT}/conf/zabbix.conf.php" && \ diff --git a/Dockerfiles/web-nginx-pgsql/alpine/Dockerfile b/Dockerfiles/web-nginx-pgsql/alpine/Dockerfile index 54ec36d72..1f2d14ef4 100644 --- a/Dockerfiles/web-nginx-pgsql/alpine/Dockerfile +++ b/Dockerfiles/web-nginx-pgsql/alpine/Dockerfile @@ -92,7 +92,6 @@ RUN set -eux && \ cd ${ZABBIX_WWW_ROOT}/ && \ rm -f conf/zabbix.conf.php conf/maintenance.inc.php conf/zabbix.conf.php.example && \ rm -rf tests && \ - rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.po' | xargs rm -f && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.sh' | xargs rm -f && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "${ZABBIX_WWW_ROOT}/conf/zabbix.conf.php" && \ diff --git a/Dockerfiles/web-nginx-pgsql/centos/Dockerfile b/Dockerfiles/web-nginx-pgsql/centos/Dockerfile index 281d197f5..15085eb43 100644 --- a/Dockerfiles/web-nginx-pgsql/centos/Dockerfile +++ b/Dockerfiles/web-nginx-pgsql/centos/Dockerfile @@ -102,7 +102,6 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ cd ${ZABBIX_WWW_ROOT}/ && \ rm -f conf/zabbix.conf.php conf/maintenance.inc.php conf/zabbix.conf.php.example && \ rm -rf tests && \ - rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.po' | xargs rm -f && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.sh' | xargs rm -f && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "${ZABBIX_WWW_ROOT}/conf/zabbix.conf.php" && \ diff --git a/Dockerfiles/web-nginx-pgsql/ol/Dockerfile b/Dockerfiles/web-nginx-pgsql/ol/Dockerfile index bff468541..de8c1b85d 100644 --- a/Dockerfiles/web-nginx-pgsql/ol/Dockerfile +++ b/Dockerfiles/web-nginx-pgsql/ol/Dockerfile @@ -89,7 +89,6 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ cd ${ZABBIX_WWW_ROOT}/ && \ rm -f conf/zabbix.conf.php conf/maintenance.inc.php conf/zabbix.conf.php.example && \ rm -rf tests && \ - rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.po' | xargs rm -f && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.sh' | xargs rm -f && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "${ZABBIX_WWW_ROOT}/conf/zabbix.conf.php" && \ diff --git a/Dockerfiles/web-nginx-pgsql/rhel/Dockerfile b/Dockerfiles/web-nginx-pgsql/rhel/Dockerfile index 68ca8f332..86f7f19a1 100644 --- a/Dockerfiles/web-nginx-pgsql/rhel/Dockerfile +++ b/Dockerfiles/web-nginx-pgsql/rhel/Dockerfile @@ -134,7 +134,6 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ cd ${ZABBIX_WWW_ROOT}/ && \ rm -f conf/zabbix.conf.php conf/maintenance.inc.php conf/zabbix.conf.php.example && \ rm -rf tests && \ - rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.po' | xargs rm -f && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.sh' | xargs rm -f && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "${ZABBIX_WWW_ROOT}/conf/zabbix.conf.php" && \ diff --git a/Dockerfiles/web-nginx-pgsql/ubuntu/Dockerfile b/Dockerfiles/web-nginx-pgsql/ubuntu/Dockerfile index eb0b0c8a4..eb1de6b4f 100644 --- a/Dockerfiles/web-nginx-pgsql/ubuntu/Dockerfile +++ b/Dockerfiles/web-nginx-pgsql/ubuntu/Dockerfile @@ -37,6 +37,7 @@ RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \ --mount=type=cache,target=/var/lib/apt/,sharing=locked \ set -eux && \ echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d && \ + export PYTHONDONTWRITEBYTECODE=1 && \ INSTALL_PKGS="bash \ tzdata \ ca-certificates \ @@ -106,7 +107,7 @@ RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \ cd ${ZABBIX_WWW_ROOT}/ && \ rm -f conf/zabbix.conf.php conf/maintenance.inc.php conf/zabbix.conf.php.example && \ rm -rf tests && \ - rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ + find /usr -name '*.pyc' -type f -exec bash -c 'for pyc_file; do dpkg -S "$pyc_file" &> /dev/null || rm -f "$pyc_file"; done' -- '{}' + && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.po' | xargs rm -f && \ find ${ZABBIX_WWW_ROOT}/locale -name '*.sh' | xargs rm -f && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "${ZABBIX_WWW_ROOT}/conf/zabbix.conf.php" && \