From b1055e454aa610561f8713c2551394fc6e411b96 Mon Sep 17 00:00:00 2001 From: Christian Heusel Date: Thu, 10 Oct 2024 19:34:22 +0200 Subject: [PATCH 1/2] Revert "T376447: fix missing liblua5.1.so.0 warning" This reverts commit 434eb6f5ce76fb6774c43ed130d3f41167b1b132. As it turns out the solutions is more complicated than wha I've implemented in this patch, see [0] for details. [0]: https://github.com/docker-library/official-images/pull/17709#issuecomment-2405588488 --- 1.39/apache/Dockerfile | 6 +----- 1.39/fpm/Dockerfile | 6 +----- 1.41/apache/Dockerfile | 6 +----- 1.41/fpm/Dockerfile | 6 +----- 1.42/apache/Dockerfile | 6 +----- 1.42/fpm/Dockerfile | 6 +----- Dockerfile-debian.template | 6 +----- 7 files changed, 7 insertions(+), 35 deletions(-) diff --git a/1.39/apache/Dockerfile b/1.39/apache/Dockerfile index 29f2d5b..4927808 100644 --- a/1.39/apache/Dockerfile +++ b/1.39/apache/Dockerfile @@ -15,14 +15,10 @@ RUN set -eux; \ # Install the PHP extensions we need RUN set -eux; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - liblua5.1-0 \ - ; \ \ savedAptMark="$(apt-mark showmanual)"; \ \ + apt-get update; \ apt-get install -y --no-install-recommends \ libicu-dev \ libonig-dev \ diff --git a/1.39/fpm/Dockerfile b/1.39/fpm/Dockerfile index 9abe285..dda51c0 100644 --- a/1.39/fpm/Dockerfile +++ b/1.39/fpm/Dockerfile @@ -15,14 +15,10 @@ RUN set -eux; \ # Install the PHP extensions we need RUN set -eux; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - liblua5.1-0 \ - ; \ \ savedAptMark="$(apt-mark showmanual)"; \ \ + apt-get update; \ apt-get install -y --no-install-recommends \ libicu-dev \ libonig-dev \ diff --git a/1.41/apache/Dockerfile b/1.41/apache/Dockerfile index bafc103..d5938a3 100644 --- a/1.41/apache/Dockerfile +++ b/1.41/apache/Dockerfile @@ -15,14 +15,10 @@ RUN set -eux; \ # Install the PHP extensions we need RUN set -eux; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - liblua5.1-0 \ - ; \ \ savedAptMark="$(apt-mark showmanual)"; \ \ + apt-get update; \ apt-get install -y --no-install-recommends \ libicu-dev \ libonig-dev \ diff --git a/1.41/fpm/Dockerfile b/1.41/fpm/Dockerfile index 160f464..25f9161 100644 --- a/1.41/fpm/Dockerfile +++ b/1.41/fpm/Dockerfile @@ -15,14 +15,10 @@ RUN set -eux; \ # Install the PHP extensions we need RUN set -eux; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - liblua5.1-0 \ - ; \ \ savedAptMark="$(apt-mark showmanual)"; \ \ + apt-get update; \ apt-get install -y --no-install-recommends \ libicu-dev \ libonig-dev \ diff --git a/1.42/apache/Dockerfile b/1.42/apache/Dockerfile index 46fbed2..9b06a0a 100644 --- a/1.42/apache/Dockerfile +++ b/1.42/apache/Dockerfile @@ -15,14 +15,10 @@ RUN set -eux; \ # Install the PHP extensions we need RUN set -eux; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - liblua5.1-0 \ - ; \ \ savedAptMark="$(apt-mark showmanual)"; \ \ + apt-get update; \ apt-get install -y --no-install-recommends \ libicu-dev \ libonig-dev \ diff --git a/1.42/fpm/Dockerfile b/1.42/fpm/Dockerfile index 21801d0..6662ce3 100644 --- a/1.42/fpm/Dockerfile +++ b/1.42/fpm/Dockerfile @@ -15,14 +15,10 @@ RUN set -eux; \ # Install the PHP extensions we need RUN set -eux; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - liblua5.1-0 \ - ; \ \ savedAptMark="$(apt-mark showmanual)"; \ \ + apt-get update; \ apt-get install -y --no-install-recommends \ libicu-dev \ libonig-dev \ diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index e6578ce..c90c71d 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -15,14 +15,10 @@ RUN set -eux; \ # Install the PHP extensions we need RUN set -eux; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - liblua5.1-0 \ - ; \ \ savedAptMark="$(apt-mark showmanual)"; \ \ + apt-get update; \ apt-get install -y --no-install-recommends \ libicu-dev \ libonig-dev \ From 02834de6db2ebb934a9145e9d58476e254374cdf Mon Sep 17 00:00:00 2001 From: Christian Heusel Date: Thu, 10 Oct 2024 19:43:12 +0200 Subject: [PATCH 2/2] T376447: fix the ldd parsing commands These ensure that no needed shared object dependencies are removed in the cleanup steps. Link: https://github.com/docker-library/official-images/pull/17709#issuecomment-2405588488 Fixes: https://phabricator.wikimedia.org/T376447 Co-authored-by: Tianon Gravi Signed-off-by: Christian Heusel --- 1.39/apache/Dockerfile | 4 ++-- 1.39/fpm/Dockerfile | 4 ++-- 1.41/apache/Dockerfile | 4 ++-- 1.41/fpm/Dockerfile | 4 ++-- 1.42/apache/Dockerfile | 4 ++-- 1.42/fpm/Dockerfile | 4 ++-- Dockerfile-debian.template | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/1.39/apache/Dockerfile b/1.39/apache/Dockerfile index 4927808..998ba5f 100644 --- a/1.39/apache/Dockerfile +++ b/1.39/apache/Dockerfile @@ -45,9 +45,9 @@ RUN set -eux; \ apt-mark auto '.*' > /dev/null; \ apt-mark manual $savedAptMark; \ ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ - | awk '/=>/ { print $3 }' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ | sort -u \ - | xargs -r dpkg-query -S \ + | xargs -r dpkg-query --search \ | cut -d: -f1 \ | sort -u \ | xargs -rt apt-mark manual; \ diff --git a/1.39/fpm/Dockerfile b/1.39/fpm/Dockerfile index dda51c0..93d071f 100644 --- a/1.39/fpm/Dockerfile +++ b/1.39/fpm/Dockerfile @@ -45,9 +45,9 @@ RUN set -eux; \ apt-mark auto '.*' > /dev/null; \ apt-mark manual $savedAptMark; \ ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ - | awk '/=>/ { print $3 }' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ | sort -u \ - | xargs -r dpkg-query -S \ + | xargs -r dpkg-query --search \ | cut -d: -f1 \ | sort -u \ | xargs -rt apt-mark manual; \ diff --git a/1.41/apache/Dockerfile b/1.41/apache/Dockerfile index d5938a3..ce8452e 100644 --- a/1.41/apache/Dockerfile +++ b/1.41/apache/Dockerfile @@ -45,9 +45,9 @@ RUN set -eux; \ apt-mark auto '.*' > /dev/null; \ apt-mark manual $savedAptMark; \ ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ - | awk '/=>/ { print $3 }' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ | sort -u \ - | xargs -r dpkg-query -S \ + | xargs -r dpkg-query --search \ | cut -d: -f1 \ | sort -u \ | xargs -rt apt-mark manual; \ diff --git a/1.41/fpm/Dockerfile b/1.41/fpm/Dockerfile index 25f9161..92b2184 100644 --- a/1.41/fpm/Dockerfile +++ b/1.41/fpm/Dockerfile @@ -45,9 +45,9 @@ RUN set -eux; \ apt-mark auto '.*' > /dev/null; \ apt-mark manual $savedAptMark; \ ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ - | awk '/=>/ { print $3 }' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ | sort -u \ - | xargs -r dpkg-query -S \ + | xargs -r dpkg-query --search \ | cut -d: -f1 \ | sort -u \ | xargs -rt apt-mark manual; \ diff --git a/1.42/apache/Dockerfile b/1.42/apache/Dockerfile index 9b06a0a..8ec9e20 100644 --- a/1.42/apache/Dockerfile +++ b/1.42/apache/Dockerfile @@ -45,9 +45,9 @@ RUN set -eux; \ apt-mark auto '.*' > /dev/null; \ apt-mark manual $savedAptMark; \ ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ - | awk '/=>/ { print $3 }' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ | sort -u \ - | xargs -r dpkg-query -S \ + | xargs -r dpkg-query --search \ | cut -d: -f1 \ | sort -u \ | xargs -rt apt-mark manual; \ diff --git a/1.42/fpm/Dockerfile b/1.42/fpm/Dockerfile index 6662ce3..e295656 100644 --- a/1.42/fpm/Dockerfile +++ b/1.42/fpm/Dockerfile @@ -45,9 +45,9 @@ RUN set -eux; \ apt-mark auto '.*' > /dev/null; \ apt-mark manual $savedAptMark; \ ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ - | awk '/=>/ { print $3 }' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ | sort -u \ - | xargs -r dpkg-query -S \ + | xargs -r dpkg-query --search \ | cut -d: -f1 \ | sort -u \ | xargs -rt apt-mark manual; \ diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index c90c71d..86cc900 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -45,9 +45,9 @@ RUN set -eux; \ apt-mark auto '.*' > /dev/null; \ apt-mark manual $savedAptMark; \ ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ - | awk '/=>/ { print $3 }' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ | sort -u \ - | xargs -r dpkg-query -S \ + | xargs -r dpkg-query --search \ | cut -d: -f1 \ | sort -u \ | xargs -rt apt-mark manual; \