RUN set -ex \
&& apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS imagemagick-dev libtool \
&& export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" \
&& pecl install imagick-3.4.3 \
&& docker-php-ext-enable imagick \
&& apk add --no-cache --virtual .imagick-runtime-deps imagemagick \
&& apk del .phpize-deps
Last active
December 7, 2023 12:01
-
-
Save johndatserakis/825a16a7f3cef4e8b4dbfbb1e80b9f9c to your computer and use it in GitHub Desktop.
Install imagick In Docker FROM php:7.1-fpm-alpine
To install and build the imagemagick
extension, the Dockerfile
contents are as follows:
FROM php:7.1-fpm-alpine
RUN set -ex && \
apk add --no-cache --virtual .build-deps \
libxml2-dev \
shadow \
autoconf \
g++ \
make \
&& apk add --no-cache imagemagick-dev imagemagick libjpeg-turbo libgomp freetype-dev \
&& pecl install imagick \
&& docker-php-ext-enable imagick \
&& apk del .build-deps
CMD ["php-fpm"]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just a side note: I recently added Alpine support to my
install-php-extensions
script: you can easily install theimagick
PHP extension (as well as many other extensions) on Alpine & Debian by running: