Skip to content

Commit 87bbb8d

Browse files
committed
Merge #417 - Fix #416 - for debian 12 issue that caused libraries for extensions to be uninstalled
Fixes: #416
2 parents adf9118 + ab6a09a commit 87bbb8d

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1010
- Update to PHP 8.2 (#411)
1111
- Add back a `/sessions` volume for sessions persistence (#399)
1212
- Support adding custom configurations in `/etc/phpmyadmin/conf.d` (#401)
13+
- Fix for debian 12 issue (#416) that caused libraries for extensions to be uninstalled
1314

1415
## [5.2.1] - 2023-02-08
1516

Dockerfile-debian.template

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,20 @@ RUN set -ex; \
2727
\
2828
apt-mark auto '.*' > /dev/null; \
2929
apt-mark manual $savedAptMark; \
30-
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
30+
extdir="$(php -r 'echo ini_get("extension_dir");')"; \
31+
ldd "$extdir"/*.so \
3132
| awk '/=>/ { print $3 }' \
33+
| awk '{print $1} {system("realpath " $1)}' \
3234
| sort -u \
3335
| xargs -r dpkg-query -S \
3436
| cut -d: -f1 \
3537
| sort -u \
3638
| xargs -rt apt-mark manual; \
3739
\
3840
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
39-
rm -rf /var/lib/apt/lists/*
41+
rm -rf /var/lib/apt/lists/*; \
42+
ldd "$extdir"/*.so | grep -qzv "=> not found" || (echo "Sanity check failed: missing libraries:"; ldd "$extdir"/*.so | grep " => not found"; exit 1); \
43+
ldd "$extdir"/*.so | grep -q "libzip.so.* => .*/libzip.so.*" || (echo "Sanity check failed: libzip.so is not referenced"; ldd "$extdir"/*.so; exit 1);
4044

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

apache/Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,20 @@ RUN set -ex; \
2727
\
2828
apt-mark auto '.*' > /dev/null; \
2929
apt-mark manual $savedAptMark; \
30-
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
30+
extdir="$(php -r 'echo ini_get("extension_dir");')"; \
31+
ldd "$extdir"/*.so \
3132
| awk '/=>/ { print $3 }' \
33+
| awk '{print $1} {system("realpath " $1)}' \
3234
| sort -u \
3335
| xargs -r dpkg-query -S \
3436
| cut -d: -f1 \
3537
| sort -u \
3638
| xargs -rt apt-mark manual; \
3739
\
3840
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
39-
rm -rf /var/lib/apt/lists/*
41+
rm -rf /var/lib/apt/lists/*; \
42+
ldd "$extdir"/*.so | grep -qzv "=> not found" || (echo "Sanity check failed: missing libraries:"; ldd "$extdir"/*.so | grep " => not found"; exit 1); \
43+
ldd "$extdir"/*.so | grep -q "libzip.so.* => .*/libzip.so.*" || (echo "Sanity check failed: libzip.so is not referenced"; ldd "$extdir"/*.so; exit 1);
4044

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

fpm/Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,20 @@ RUN set -ex; \
2727
\
2828
apt-mark auto '.*' > /dev/null; \
2929
apt-mark manual $savedAptMark; \
30-
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
30+
extdir="$(php -r 'echo ini_get("extension_dir");')"; \
31+
ldd "$extdir"/*.so \
3132
| awk '/=>/ { print $3 }' \
33+
| awk '{print $1} {system("realpath " $1)}' \
3234
| sort -u \
3335
| xargs -r dpkg-query -S \
3436
| cut -d: -f1 \
3537
| sort -u \
3638
| xargs -rt apt-mark manual; \
3739
\
3840
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
39-
rm -rf /var/lib/apt/lists/*
41+
rm -rf /var/lib/apt/lists/*; \
42+
ldd "$extdir"/*.so | grep -qzv "=> not found" || (echo "Sanity check failed: missing libraries:"; ldd "$extdir"/*.so | grep " => not found"; exit 1); \
43+
ldd "$extdir"/*.so | grep -q "libzip.so.* => .*/libzip.so.*" || (echo "Sanity check failed: libzip.so is not referenced"; ldd "$extdir"/*.so; exit 1);
4044

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

0 commit comments

Comments
 (0)