fix(IMAGEMAGICK extension): implement building extension for PHP 8.0 from source

We need to build imagemagick extension from sources due the latest version, that supports PHP 8.0 has not been released to PECL.

Closes #2861
This commit is contained in:
Pavel Savushkin
2021-03-12 03:20:32 +02:00
parent fd203fba04
commit 67cc72da62
6 changed files with 98 additions and 13 deletions

View File

@ -74,10 +74,28 @@ RUN if [ ${INSTALL_GMP} = true ]; then \
#Install ImageMagick package:
ARG INSTALL_IMAGEMAGICK=false
ARG IMAGEMAGICK_VERSION=latest
ENV IMAGEMAGICK_VERSION ${IMAGEMAGICK_VERSION}
RUN set -eux; \
if [ ${INSTALL_IMAGEMAGICK} = true ]; then \
apk add --update --no-cache imagemagick-dev; \
pecl install imagick; \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \
apk add --update --no-cache git && \
cd /tmp && \
if [ ${IMAGEMAGICK_VERSION} = "latest" ]; then \
git clone https://github.com/Imagick/imagick; \
else \
git clone --branch ${IMAGEMAGICK_VERSION} https://github.com/Imagick/imagick; \
fi && \
cd imagick && \
phpize && \
./configure && \
make && \
make install && \
rm -r /tmp/imagick; \
else \
pecl install imagick; \
fi && \
docker-php-ext-enable imagick; \
php -m | grep -q 'imagick'; \
fi