diff --git a/Dockerfile.template b/Dockerfile.template index dc230630a5..2296928274 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -111,9 +111,9 @@ RUN set -ex; \ apt-mark auto '.*' > /dev/null; \ apt-mark manual $savedAptMark; \ ldd "$extDir"/*.so \ - | awk '/=>/ { print $3 }' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print 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/beta/php8.0/apache/Dockerfile b/beta/php8.0/apache/Dockerfile index f4ed393b61..7530524270 100644 --- a/beta/php8.0/apache/Dockerfile +++ b/beta/php8.0/apache/Dockerfile @@ -61,9 +61,9 @@ RUN set -ex; \ apt-mark auto '.*' > /dev/null; \ apt-mark manual $savedAptMark; \ ldd "$extDir"/*.so \ - | awk '/=>/ { print $3 }' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print 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/beta/php8.0/fpm/Dockerfile b/beta/php8.0/fpm/Dockerfile index 893ae5eeb7..1c486500eb 100644 --- a/beta/php8.0/fpm/Dockerfile +++ b/beta/php8.0/fpm/Dockerfile @@ -61,9 +61,9 @@ RUN set -ex; \ apt-mark auto '.*' > /dev/null; \ apt-mark manual $savedAptMark; \ ldd "$extDir"/*.so \ - | awk '/=>/ { print $3 }' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print 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/beta/php8.1/apache/Dockerfile b/beta/php8.1/apache/Dockerfile index cab48d9afb..e2bc6f598e 100644 --- a/beta/php8.1/apache/Dockerfile +++ b/beta/php8.1/apache/Dockerfile @@ -61,9 +61,9 @@ RUN set -ex; \ apt-mark auto '.*' > /dev/null; \ apt-mark manual $savedAptMark; \ ldd "$extDir"/*.so \ - | awk '/=>/ { print $3 }' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print 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/beta/php8.1/fpm/Dockerfile b/beta/php8.1/fpm/Dockerfile index 57b2304ef5..02234fc80c 100644 --- a/beta/php8.1/fpm/Dockerfile +++ b/beta/php8.1/fpm/Dockerfile @@ -61,9 +61,9 @@ RUN set -ex; \ apt-mark auto '.*' > /dev/null; \ apt-mark manual $savedAptMark; \ ldd "$extDir"/*.so \ - | awk '/=>/ { print $3 }' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print 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/beta/php8.2/apache/Dockerfile b/beta/php8.2/apache/Dockerfile index 954553526b..5967d31c84 100644 --- a/beta/php8.2/apache/Dockerfile +++ b/beta/php8.2/apache/Dockerfile @@ -61,9 +61,9 @@ RUN set -ex; \ apt-mark auto '.*' > /dev/null; \ apt-mark manual $savedAptMark; \ ldd "$extDir"/*.so \ - | awk '/=>/ { print $3 }' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print 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/beta/php8.2/fpm/Dockerfile b/beta/php8.2/fpm/Dockerfile index 132740c984..120cc1690c 100644 --- a/beta/php8.2/fpm/Dockerfile +++ b/beta/php8.2/fpm/Dockerfile @@ -61,9 +61,9 @@ RUN set -ex; \ apt-mark auto '.*' > /dev/null; \ apt-mark manual $savedAptMark; \ ldd "$extDir"/*.so \ - | awk '/=>/ { print $3 }' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print 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/latest/php8.0/apache/Dockerfile b/latest/php8.0/apache/Dockerfile index f4ed393b61..7530524270 100644 --- a/latest/php8.0/apache/Dockerfile +++ b/latest/php8.0/apache/Dockerfile @@ -61,9 +61,9 @@ RUN set -ex; \ apt-mark auto '.*' > /dev/null; \ apt-mark manual $savedAptMark; \ ldd "$extDir"/*.so \ - | awk '/=>/ { print $3 }' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print 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/latest/php8.0/fpm/Dockerfile b/latest/php8.0/fpm/Dockerfile index 893ae5eeb7..1c486500eb 100644 --- a/latest/php8.0/fpm/Dockerfile +++ b/latest/php8.0/fpm/Dockerfile @@ -61,9 +61,9 @@ RUN set -ex; \ apt-mark auto '.*' > /dev/null; \ apt-mark manual $savedAptMark; \ ldd "$extDir"/*.so \ - | awk '/=>/ { print $3 }' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print 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/latest/php8.1/apache/Dockerfile b/latest/php8.1/apache/Dockerfile index cab48d9afb..e2bc6f598e 100644 --- a/latest/php8.1/apache/Dockerfile +++ b/latest/php8.1/apache/Dockerfile @@ -61,9 +61,9 @@ RUN set -ex; \ apt-mark auto '.*' > /dev/null; \ apt-mark manual $savedAptMark; \ ldd "$extDir"/*.so \ - | awk '/=>/ { print $3 }' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print 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/latest/php8.1/fpm/Dockerfile b/latest/php8.1/fpm/Dockerfile index 57b2304ef5..02234fc80c 100644 --- a/latest/php8.1/fpm/Dockerfile +++ b/latest/php8.1/fpm/Dockerfile @@ -61,9 +61,9 @@ RUN set -ex; \ apt-mark auto '.*' > /dev/null; \ apt-mark manual $savedAptMark; \ ldd "$extDir"/*.so \ - | awk '/=>/ { print $3 }' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print 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/latest/php8.2/apache/Dockerfile b/latest/php8.2/apache/Dockerfile index 954553526b..5967d31c84 100644 --- a/latest/php8.2/apache/Dockerfile +++ b/latest/php8.2/apache/Dockerfile @@ -61,9 +61,9 @@ RUN set -ex; \ apt-mark auto '.*' > /dev/null; \ apt-mark manual $savedAptMark; \ ldd "$extDir"/*.so \ - | awk '/=>/ { print $3 }' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print 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/latest/php8.2/fpm/Dockerfile b/latest/php8.2/fpm/Dockerfile index 132740c984..120cc1690c 100644 --- a/latest/php8.2/fpm/Dockerfile +++ b/latest/php8.2/fpm/Dockerfile @@ -61,9 +61,9 @@ RUN set -ex; \ apt-mark auto '.*' > /dev/null; \ apt-mark manual $savedAptMark; \ ldd "$extDir"/*.so \ - | awk '/=>/ { print $3 }' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \ | sort -u \ - | xargs -r dpkg-query -S \ + | xargs -r dpkg-query --search \ | cut -d: -f1 \ | sort -u \ | xargs -rt apt-mark manual; \