From aab2aee3e28fc5d6ecc368fea3d4934cf8324468 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Szo=C5=82tysek?= Date: Mon, 7 Oct 2024 11:17:21 +0200 Subject: [PATCH] imagick workaround --- php/Dockerfile-8.3 | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/php/Dockerfile-8.3 b/php/Dockerfile-8.3 index 85edd7b..6c8808a 100644 --- a/php/Dockerfile-8.3 +++ b/php/Dockerfile-8.3 @@ -80,8 +80,23 @@ RUN set -xe \ && cp /usr/src/php/php.ini-production ${PHP_INI_DIR}/php.ini \ \ # Install imagemagick - && for i in $(seq 1 3); do pecl install -o imagick && s=0 && break || s=$? && sleep 1; done; (exit $s) \ - && docker-php-ext-enable imagick \ +# && for i in $(seq 1 3); do pecl install -o imagick && s=0 && break || s=$? && sleep 1; done; (exit $s) \ +# && docker-php-ext-enable imagick \ + +ARG IMAGICK_VERSION=3.7.0 + +# Imagick is installed from the archive because regular installation fails +# See: https://github.com/Imagick/imagick/issues/643#issuecomment-1834361716 +RUN curl -L -o /tmp/imagick.tar.gz https://github.com/Imagick/imagick/archive/refs/tags/${IMAGICK_VERSION}.tar.gz \ + && tar --strip-components=1 -xf /tmp/imagick.tar.gz \ + && phpize \ + && ./configure \ + && make \ + && make install \ + && echo "extension=imagick.so" > /usr/local/etc/php/conf.d/ext-imagick.ini \ + && rm -rf /tmp/* + # <<< End of Imagick installation + # Install xdebug && for i in $(seq 1 3); do echo yes | pecl install -o "xdebug" && s=0 && break || s=$? && sleep 1; done; (exit $s) \ # Install blackfire: https://blackfire.io/docs/integrations/docker