I am trying to get ImageMagick and it’s PHP extension working on a docker image
Docker Image:
FROM laravelphp/vapor:php81
RUN apk add imagemagick imagemagick-dev
RUN pecl install imagick
RUN docker-php-ext-enable imagick
COPY . /var/task
Running these commands gives the following error
Step 1/5 : FROM laravelphp/vapor:php81
php81: Pulling from laravelphp/vapor
Digest: sha256:571d520c322df43e1a48ac28e1ff3ad88bf53a35d23837affd35f72fcdb35abd
Status: Image is up to date for laravelphp/vapor:php81
---> 46ebf272fe20
Step 2/5 : RUN apk add imagemagick imagemagick-dev
---> Using cache
---> 375e8ed62ce3
Step 3/5 : RUN pecl install imagick
---> Running in bc31590649b8
No releases available for package "pecl.php.net/imagick"
install failed
What can I change to make pecl install imagick
?
2
Answers
In my case got it working with the following Dockerfile:
I can share with you my working dockerfile: