php icon indicating copy to clipboard operation
php copied to clipboard

Adding php-imagick extension to Alpine Docker container fails

Open 4d4ch4u32 opened this issue 6 months ago • 3 comments

I try to add the imagick php extension to my Docker container:

FROM php:8.3-fpm-alpine AS base

RUN apk add --update --no-cache --virtual .build-deps $PHPIZE_DEPS imagemagick imagemagick-dev \
    && pecl install imagick \
    && docker-php-ext-enable imagick \
    &&  rm -rf /tmp/pear \
    && apk del .build-deps

The process fails with the following error:

14.37 PHP-Parser-5.0.0/phpstan.neon.dist
14.38 Saved /tmp/pear/temp/imagick/ImagickPixel_arginfo.h
14.38 Parse /tmp/pear/temp/imagick/Imagick.stub.php to generate /tmp/pear/temp/imagick/Imagick_arginfo.h
14.41 In /tmp/pear/temp/imagick/Imagick.stub.php:
14.41 Unterminated preprocessor conditions
14.41 make: *** [Makefile:196: /tmp/pear/temp/imagick/Imagick_arginfo.h] Error 1
14.41 ERROR: `make INSTALL_ROOT="/tmp/pear/temp/pear-build-defaultuserAclDeF/install-imagick-3.7.0" install' failed
------
failed to solve: process "/bin/sh -c apk add --update --no-cache --virtual .build-deps $PHPIZE_DEPS imagemagick imagemagick-dev     && pecl install imagick     && docker-php-ext-enable imagick     &&  rm -rf /tmp/pear     && apk del .build-deps" did not complete successfully: exit code: 1

4d4ch4u32 avatar Jul 30 '24 09:07 4d4ch4u32