Skip to content

Commit

Permalink
Merge #418 - improve the fix made in #417
Browse files Browse the repository at this point in the history
Ref: 87bbb8d
  • Loading branch information
williamdes committed Jul 4, 2023
2 parents 692333a + da4b8f2 commit 30db079
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
7 changes: 4 additions & 3 deletions Dockerfile-debian.template
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ RUN set -ex; \
apt-mark manual $savedAptMark; \
extdir="$(php -r 'echo ini_get("extension_dir");')"; \
ldd "$extdir"/*.so \
| awk '/=>/ { print $3 }' \
| awk '{print $1} {system("realpath " $1)}' \
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
| sort -u \
| xargs -r dpkg-query -S \
| cut -d: -f1 \
Expand All @@ -41,7 +40,9 @@ RUN set -ex; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*; \
ldd "$extdir"/*.so | grep -qzv "=> not found" || (echo "Sanity check failed: missing libraries:"; ldd "$extdir"/*.so | grep " => not found"; exit 1); \
ldd "$extdir"/*.so | grep -q "libzip.so.* => .*/libzip.so.*" || (echo "Sanity check failed: libzip.so is not referenced"; ldd "$extdir"/*.so; exit 1);
ldd "$extdir"/*.so | grep -q "libzip.so.* => .*/libzip.so.*" || (echo "Sanity check failed: libzip.so is not referenced"; ldd "$extdir"/*.so; exit 1); \
err="$(php --version 3>&1 1>&2 2>&3)"; \
[ -z "$err" ] || (echo "Sanity check failed: php returned errors; $err"; exit 1;);

# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
Expand Down
7 changes: 4 additions & 3 deletions apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ RUN set -ex; \
apt-mark manual $savedAptMark; \
extdir="$(php -r 'echo ini_get("extension_dir");')"; \
ldd "$extdir"/*.so \
| awk '/=>/ { print $3 }' \
| awk '{print $1} {system("realpath " $1)}' \
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
| sort -u \
| xargs -r dpkg-query -S \
| cut -d: -f1 \
Expand All @@ -42,7 +41,9 @@ RUN set -ex; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*; \
ldd "$extdir"/*.so | grep -qzv "=> not found" || (echo "Sanity check failed: missing libraries:"; ldd "$extdir"/*.so | grep " => not found"; exit 1); \
ldd "$extdir"/*.so | grep -q "libzip.so.* => .*/libzip.so.*" || (echo "Sanity check failed: libzip.so is not referenced"; ldd "$extdir"/*.so; exit 1);
ldd "$extdir"/*.so | grep -q "libzip.so.* => .*/libzip.so.*" || (echo "Sanity check failed: libzip.so is not referenced"; ldd "$extdir"/*.so; exit 1); \
err="$(php --version 3>&1 1>&2 2>&3)"; \
[ -z "$err" ] || (echo "Sanity check failed: php returned errors; $err"; exit 1;);

# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
Expand Down
7 changes: 4 additions & 3 deletions fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ RUN set -ex; \
apt-mark manual $savedAptMark; \
extdir="$(php -r 'echo ini_get("extension_dir");')"; \
ldd "$extdir"/*.so \
| awk '/=>/ { print $3 }' \
| awk '{print $1} {system("realpath " $1)}' \
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
| sort -u \
| xargs -r dpkg-query -S \
| cut -d: -f1 \
Expand All @@ -42,7 +41,9 @@ RUN set -ex; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*; \
ldd "$extdir"/*.so | grep -qzv "=> not found" || (echo "Sanity check failed: missing libraries:"; ldd "$extdir"/*.so | grep " => not found"; exit 1); \
ldd "$extdir"/*.so | grep -q "libzip.so.* => .*/libzip.so.*" || (echo "Sanity check failed: libzip.so is not referenced"; ldd "$extdir"/*.so; exit 1);
ldd "$extdir"/*.so | grep -q "libzip.so.* => .*/libzip.so.*" || (echo "Sanity check failed: libzip.so is not referenced"; ldd "$extdir"/*.so; exit 1); \
err="$(php --version 3>&1 1>&2 2>&3)"; \
[ -z "$err" ] || (echo "Sanity check failed: php returned errors; $err"; exit 1;);

# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
Expand Down

0 comments on commit 30db079

Please sign in to comment.