Skip to content

Instantly share code, notes, and snippets.

@ptflp
Last active December 7, 2023 12:20
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ptflp/5cc7ff386ed3338bac4033ec13c339e9 to your computer and use it in GitHub Desktop.
Save ptflp/5cc7ff386ed3338bac4033ec13c339e9 to your computer and use it in GitHub Desktop.
docker php install imagemagick alpine 3.8
FROM php:7.0-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"]
@peter279k
Copy link

The Dockerfile contents should change into the following contents:

FROM php:7.0-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"]

@ptflp
Copy link
Author

ptflp commented Dec 7, 2023

@peter279k thank you, updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment