Last active
December 16, 2018 21:43
-
-
Save michaelperrin/59fb8e425abb1e62c5711929d637d994 to your computer and use it in GitHub Desktop.
PHP extension recipes for Docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:7.2-fpm | |
RUN pecl install apcu \ | |
&& docker-php-ext-enable apcu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM composer:1.8 as composer | |
FROM php:7.1-fpm | |
# Add Composer to PHP container | |
COPY --from=composer /usr/bin/composer /usr/local/bin/composer | |
# Necessary packages for Composer | |
RUN apt-get update \ | |
&& apt-get install -y \ | |
git \ | |
unzip | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:7.2-fpm | |
RUN apt-get update && apt-get install -y \ | |
libfreetype6-dev \ | |
libjpeg62-turbo-dev \ | |
libpng-dev \ | |
&& docker-php-ext-install -j$(nproc) iconv \ | |
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ | |
&& docker-php-ext-install -j$(nproc) gd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM PHP:7.1-fpm | |
RUN apt-get update \ | |
&& apt-get install -y --no-install-recommends \ | |
libmagickwand-dev \ | |
&& rm -rf /var/lib/apt/lists/* \ | |
&& pecl install imagick-3.4.3 \ | |
&& docker-php-ext-enable imagick |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:7.2-fpm | |
# Necessary packages for PDO PgSQL | |
# See https://github.com/docker-library/php/issues/221 | |
RUN apt-get update && apt-get install -y libpq-dev \ | |
&& docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \ | |
&& docker-php-ext-install pdo pdo_pgsql pgsql | |
RUN docker-php-ext-install pdo_pgsql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:7.2-fpm | |
RUN pecl install -o -f redis \ | |
&& rm -rf /tmp/pear \ | |
&& docker-php-ext-enable redis |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:7.2-fpm | |
# Install recommended extensions for Symfony | |
RUN apt-get update && apt-get install -y \ | |
libicu-dev \ | |
&& docker-php-ext-install \ | |
intl \ | |
opcache \ | |
&& docker-php-ext-enable \ | |
intl \ | |
opcache |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:7.2-fpm | |
# Zip extension is necessary for Spout library for instance | |
RUN apt-get update \ | |
&& apt-get install -y zlib1g-dev \ | |
&& docker-php-ext-install zip | |
RUN apt-get update && apt-get install -y \ | |
libzip-dev \ | |
zip \ | |
&& docker-php-ext-configure zip --with-libzip \ | |
&& docker-php-ext-install zip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment