Last active
August 27, 2024 18:56
-
-
Save marsyang1/8e7fedfbf5992fba8bc1571b4e066be2 to your computer and use it in GitHub Desktop.
PHP7 alpine with pdo , pdo mysql , 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
# reference gd: https://github.com/docker-library/php/issues/225 | |
# pdo : https://github.com/docker-library/php/issues/62 | |
FROM php:7-fpm-alpine | |
# PHP extensions | |
RUN docker-php-ext-install pdo pdo_mysql | |
RUN apk add --no-cache freetype libpng libjpeg-turbo freetype-dev libpng-dev libjpeg-turbo-dev && \ | |
docker-php-ext-configure gd \ | |
--with-gd \ | |
--with-freetype-dir=/usr/include/ \ | |
--with-png-dir=/usr/include/ \ | |
--with-jpeg-dir=/usr/include/ && \ | |
NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && \ | |
docker-php-ext-install -j${NPROC} gd && \ | |
apk del --no-cache freetype-dev libpng-dev libjpeg-turbo-dev |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment