Skip to content

Instantly share code, notes, and snippets.

@marufmax
Created June 9, 2021 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marufmax/d24e2a144333be4f1f10e4df2d760ab1 to your computer and use it in GitHub Desktop.
Save marufmax/d24e2a144333be4f1f10e4df2d760ab1 to your computer and use it in GitHub Desktop.
PHP 8 with Imagick Dockerfile
## This is a very basic PHP 8 Dockerfile with Imagick installed from source
## Modify/Customize this file as per your need
FROM php:8.0-fpm
RUN apt-get update && \
apt-get install openssl -y && \
apt-get install libssl-dev -y && \
apt-get install wget -y && \
apt-get install git -y && \
apt-get install imagemagick libmagickwand-dev --no-install-recommends -y
# Imagick
RUN cd /tmp && git clone https://github.com/Imagick/imagick && \
cd imagick && \
phpize && \
./configure && \
make && make install
RUN touch /usr/local/etc/php/conf.d/imagick.ini && \
echo 'extension=imagick.so' > /usr/local/etc/php/conf.d/imagick.ini
# RUN wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_amd64
# RUN chmod +x /usr/local/bin/dumb-init
RUN apt-get autoremove -y && rm -rf /var/lib/apt/lists/*
EXPOSE 9000
WORKDIR /var/www
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment