docker php gd库安装

511次阅读
# 从官方基础版本构建  docker build -t heiyeyi/php7.4.16-fpm:20210311 .
FROM php:7.4.16-fpm
# 官方版本默认安装扩展:
# Core, ctype, curl
# date, dom
# fileinfo, filter, ftp
# hash
# iconv
# json
# libxml
# mbstring, mysqlnd
# openssl
# pcre, PDO, pdo_sqlite, Phar, posix
# readline, Reflection, session, SimpleXML, sodium, SPL, sqlite3, standard
# tokenizer
# xml, xmlreader, xmlwriter
# zlib
RUN apt-get update \
    && apt-get install --no-install-recommends -y libzip-dev libjpeg62-turbo-dev libpng-dev libmagickwand-dev \
    && docker-php-ext-install bcmath exif gettext mysqli pdo_mysql \
# GD 扩展
    && docker-php-ext-configure gd --with-jpeg \
    && docker-php-ext-install gd \
# redis 扩展
#    && pecl install redis-5.0.0 && docker-php-ext-enable redis \
# opcache 扩展
    && docker-php-ext-configure opcache --enable-opcache && docker-php-ext-install opcache \
# xdebug 扩展
#    && pecl install xdebug && docker-php-ext-enable xdebug \
# ZIP
  && pecl install zip && docker-php-ext-enable zip \
  && pecl install imagick \
  && docker-php-ext-enable imagick \
# swoole 扩展
# RUN pecl install swoole-4.4.0 && docker-php-ext-enable swoole
# yaf 扩展
#    && pecl install yaf && docker-php-ext-enable yaf \
# 清理
#    && apt remove -y --auto-remove  \
    && apt-get autoremove && apt-get autoclean \
    && rm  -rf /var/lib/apt/lists/*

 

FROM php:7.4-fpm-alpine

RUN docker-php-ext-install -j$(nproc) mysqli opcache

ADD php.ini /usr/local/etc/php.ini
FROM php:7.4-fpm-alpine

RUN apk add --update --no-cache libgd libpng-dev libjpeg-turbo-dev freetype-dev

RUN docker-php-ext-install -j$(nproc) gd

ADD php.ini /usr/local/etc/php.ini

 

正文完