docker-php-extension-installer icon indicating copy to clipboard operation
docker-php-extension-installer copied to clipboard

Imagick PDF decorators missing on Alpine 3.19

Open eddy84 opened this issue 2 years ago • 6 comments

Version of install-php-extensions

latest

Error description

As written in this issue: https://github.com/ImageMagick/ImageMagick/issues/6935

Imagick packages were split up into separate packages on alpine:3.19

We can't use imagick with PDFs anymore because imagemagick-pdf needs to be installed

I had to restrict our docker image to the previous version for now: php:8.2-fpm-alpine3.18

Docker image

php:8.2-fpm-alpine

Minimal Dockerfile

ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN chmod uga+x /usr/local/bin/install-php-extensions && sync

# Install php extensions
RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
#    && apk add --no-cache libedit-dev postgresql-dev libcurl \
    && install-php-extensions \
      bcmath \
      curl \
      exif \
      gd \
      gettext \
      iconv \
      igbinary\
      imagick \
      imap \
      intl \
      mbstring \
      mcrypt \
      opcache \
      pcntl \
      pgsql \
      pdo \
      pdo_pgsql\
      redis \
      xml \
      xsl \
      zip \
    && rm -f /var/cache/apk/*

eddy84 avatar Dec 15 '23 16:12 eddy84

Indeed, it would be nice to know why we can't install imagick for PHP 8.3. I assume these extra dependencies for Alpine 3.19+ will need to be listed somewhere.

I too will need to stick with PHP 8.2 on Alpine 3.18 as a result, for now.

hexus avatar Jan 22 '24 16:01 hexus

it would be nice to know why we can't install imagick for PHP 8.3

See https://github.com/Imagick/imagick/pull/641

mlocati avatar Jan 22 '24 18:01 mlocati

Thanks @mlocati, I landed there in the end after a little searching. Guess we're just waiting for the upstream. 🙂

hexus avatar Jan 22 '24 18:01 hexus

Indeed.

mlocati avatar Jan 22 '24 18:01 mlocati

Before Alpine 3.18 we had to use this hack https://github.com/mvorisek/image-php/blob/a38b8a1ac588e68e5ed74a59dbd97b17e0b3a710/data/8.2-alpine/Dockerfile#L38 to reduce the image size.

related with upstream change https://gitlab.alpinelinux.org/alpine/aports/-/commit/61dce5f6a84d9f96ab7aa6437f12d2845b572ed8

I belive some basic codes like pdf should be always present on all OS (Debian, Alpine). Not sure is any codec still require the useless Ghostscript CLI app.

mvorisek avatar Feb 06 '24 10:02 mvorisek

Hi — did anyone figure out a workaround for this?

mateusjatenee avatar May 17 '24 14:05 mateusjatenee