Skip to content

Instantly share code, notes, and snippets.

@marsyang1
Last active August 27, 2024 18:56
Show Gist options
  • Save marsyang1/8e7fedfbf5992fba8bc1571b4e066be2 to your computer and use it in GitHub Desktop.
Save marsyang1/8e7fedfbf5992fba8bc1571b4e066be2 to your computer and use it in GitHub Desktop.
PHP7 alpine with pdo , pdo mysql , gd
# 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