Docker – PHP 7.2 FPM Alpine – Imagick

CappY asked:

I’m using Docker image php:7.2-fpm-alpine as base image with following command to install Imagick:

RUN apk add --update --no-cache autoconf g++ imagemagick-dev libtool make pcre-dev \
    && pecl install imagick \
    && docker-php-ext-enable imagick \
    && apk del autoconf g++ libtool make pcre-dev

Everything went fine with build and I have php7.2 with Imagick but it cannot be used because of following error:

UnableToOpenConfigureFile `coder.xml' @ warning/configure.c/GetConfigureOptions/714

I’m trying to fix this for two hours. I tried with adding XML libraries without any luck. Any ideas?

My answer:


The files you are missing are in the imagemagick package, which you also need to apk add explicitly. The dependencies for imagemagick-dev do not pull it in.


View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.