Skip to content

Commit aab2aee

Browse files
committed
imagick workaround
1 parent e6ac11f commit aab2aee

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

php/Dockerfile-8.3

+17-2
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,23 @@ RUN set -xe \
8080
&& cp /usr/src/php/php.ini-production ${PHP_INI_DIR}/php.ini \
8181
\
8282
# Install imagemagick
83-
&& for i in $(seq 1 3); do pecl install -o imagick && s=0 && break || s=$? && sleep 1; done; (exit $s) \
84-
&& docker-php-ext-enable imagick \
83+
# && for i in $(seq 1 3); do pecl install -o imagick && s=0 && break || s=$? && sleep 1; done; (exit $s) \
84+
# && docker-php-ext-enable imagick \
85+
86+
ARG IMAGICK_VERSION=3.7.0
87+
88+
# Imagick is installed from the archive because regular installation fails
89+
# See: https://github.com/Imagick/imagick/issues/643#issuecomment-1834361716
90+
RUN curl -L -o /tmp/imagick.tar.gz https://github.com/Imagick/imagick/archive/refs/tags/${IMAGICK_VERSION}.tar.gz \
91+
&& tar --strip-components=1 -xf /tmp/imagick.tar.gz \
92+
&& phpize \
93+
&& ./configure \
94+
&& make \
95+
&& make install \
96+
&& echo "extension=imagick.so" > /usr/local/etc/php/conf.d/ext-imagick.ini \
97+
&& rm -rf /tmp/*
98+
# <<< End of Imagick installation
99+
85100
# Install xdebug
86101
&& for i in $(seq 1 3); do echo yes | pecl install -o "xdebug" && s=0 && break || s=$? && sleep 1; done; (exit $s) \
87102
# Install blackfire: https://blackfire.io/docs/integrations/docker

0 commit comments

Comments
 (0)