Skip to content

Instantly share code, notes, and snippets.

@tristanlins
Created October 10, 2015 15:41
Show Gist options
  • Star 58 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
  • Save tristanlins/4c1da2508f0326a042aa to your computer and use it in GitHub Desktop.
Save tristanlins/4c1da2508f0326a042aa to your computer and use it in GitHub Desktop.
Docker PHP extension recipes
FROM php:5.6-cli
RUN apt-get update \
&& apt-get install -y \
libfreetype6-dev \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-install iconv \
&& apt-get remove -y \
libfreetype6-dev \
&& apt-get install -y \
libfreetype6 \
&& apt-get autoremove -y
CMD ["php"]
FROM php:5.6-cli
RUN apt-get update \
&& apt-get install -y \
libmagickwand-dev \
&& rm -rf /var/lib/apt/lists/* \
&& pecl install imagick-beta \
&& echo "extension=imagick.so" > /usr/local/etc/php/conf.d/ext-imagick.ini \
&& apt-get remove -y \
libmagickwand-dev \
&& apt-get install -y \
libmagickwand-6.q16-2 \
&& apt-get autoremove -y
CMD ["php"]
FROM php:5.6-cli
RUN apt-get update \
&& apt-get install -y \
libicu-dev \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-install intl \
&& apt-get remove -y \
libicu-dev \
&& apt-get install -y \
libicu52 \
libltdl7 \
&& apt-get autoremove -y
CMD ["php"]
FROM php:5.6-cli
RUN apt-get update \
&& apt-get install -y \
libmcrypt-dev \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-install mcrypt \
&& apt-get remove -y \
libmcrypt-dev \
&& apt-get install -y \
libmcrypt4 \
&& apt-get autoremove -y
CMD ["php"]
FROM php:5.6-cli
RUN apt-get update \
&& apt-get install -y \
libmemcached-dev \
&& rm -rf /var/lib/apt/lists/* \
&& pecl install memcached \
&& echo "extension=memcached.so" > /usr/local/etc/php/conf.d/ext-memcached.ini \
&& apt-get remove -y \
libmemcached-dev \
&& apt-get install -y \
libmemcached11 \
libmemcachedutil2 \
&& apt-get autoremove -y
CMD ["php"]
FROM php:5.6-cli
RUN apt-get update \
&& apt-get install -y \
postgresql-server-dev-9.4 \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-install pdo_pgsql \
&& apt-get remove -y \
postgresql-server-dev-9.4 \
&& apt-get install -y \
libpq5 \
&& apt-get autoremove -y
CMD ["php"]
FROM php:5.6-cli
RUN apt-get update \
&& apt-get install -y \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-install zip \
&& apt-get remove -y \
zlib1g-dev \
&& apt-get install -y \
zlib1g \
&& apt-get autoremove -y
CMD ["php"]
@vukanac
Copy link

vukanac commented Dec 25, 2017

FROM php:7.1-fpm

RUN apt-get update
&& apt-get install -y --no-install-recommends
libmagickwand-dev
&& rm -rf /var/lib/apt/lists/*

RUN pecl install imagick-3.4.3
&& docker-php-ext-enable imagick

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