From 751aaa533fcf9d0fb27fc1321bf75203b407a7ff Mon Sep 17 00:00:00 2001 From: le0m Date: Tue, 30 Jan 2024 15:09:04 +0100 Subject: [PATCH] fix: workaround to install Imagick with PHP >= 8.3 --- Dockerfile.alpine | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile.alpine b/Dockerfile.alpine index 9fddb5c..804a911 100644 --- a/Dockerfile.alpine +++ b/Dockerfile.alpine @@ -21,7 +21,6 @@ RUN apk add --no-cache \ exif \ gd \ gettext \ - imagick \ intl \ ldap \ memcached \ @@ -40,6 +39,11 @@ RUN apk add --no-cache \ 5.6.*) PHP_EXTENSIONS="$PHP_EXTENSIONS mcrypt mysql";; \ 7.0.*|7.1.*) PHP_EXTENSIONS="$PHP_EXTENSIONS mcrypt";; \ esac \ + # Install Imagick from master on PHP >= 8.3, because imagick 3.7.0 broke on latest PHP releases and Imagick maintainers don't care to tag a newer release + && if [ $(php -r 'echo PHP_VERSION_ID;') -lt 80300 ]; then \ + PHP_EXTENSIONS="$PHP_EXTENSIONS imagick"; \ + else PHP_EXTENSIONS="$PHP_EXTENSIONS https://api.github.com/repos/Imagick/imagick/tarball/28f27044e435a2b203e32675e942eb8de620ee58"; \ + fi \ && install-php-extensions $PHP_EXTENSIONS \ && if command -v a2enmod; then a2enmod rewrite; fi