Docker PHP 安装扩展汇总
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Docker PHP 安装扩展汇总相关的知识,希望对你有一定的参考价值。
参考技术A FROM php:7.2-fpmCore, 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 docker-php-ext-install -j$(nproc) bcmath calendar exif gettext
sockets dba mysqli pcntl pdo_mysql shmop sysvmsg sysvsem sysvshm
RUN apt-get update &&
apt-get install -y --no-install-recommends libbz2-dev &&
rm -r /var/lib/apt/lists/* &&
docker-php-ext-install -j$(nproc) bz2
RUN apt-get update &&
apt-get install -y --no-install-recommends libenchant-dev &&
rm -r /var/lib/apt/lists/* &&
docker-php-ext-install -j$(nproc) enchant
RUN apt-get update &&
apt-get install -y --no-install-recommends libfreetype6-dev libjpeg62-turbo-dev libpng-dev &&
rm -r /var/lib/apt/lists/* &&
docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ &&
docker-php-ext-install -j$(nproc) gd
RUN apt-get update &&
apt-get install -y --no-install-recommends libgmp-dev &&
rm -r /var/lib/apt/lists/* &&
docker-php-ext-install -j$(nproc) gmp
RUN apt-get update &&
apt-get install -y --no-install-recommends libxml2-dev libtidy-dev libxslt1-dev &&
rm -r /var/lib/apt/lists/* &&
docker-php-ext-install -j$(nproc) soap wddx xmlrpc tidy xsl
RUN apt-get update &&
apt-get install -y --no-install-recommends libzip-dev &&
rm -r /var/lib/apt/lists/* &&
docker-php-ext-install -j$(nproc) zip
RUN apt-get update &&
apt-get install -y --no-install-recommends libsnmp-dev &&
rm -r /var/lib/apt/lists/* &&
docker-php-ext-install -j$(nproc) snmp
RUN apt-get update &&
apt-get install -y --no-install-recommends libpq-dev &&
rm -r /var/lib/apt/lists/* &&
docker-php-ext-install -j$(nproc) pgsql pdo_pgsql
RUN apt-get update &&
apt-get install -y --no-install-recommends libpspell-dev &&
rm -r /var/lib/apt/lists/* &&
docker-php-ext-install -j$(nproc) pspell
RUN apt-get update &&
apt-get install -y --no-install-recommends librecode-dev &&
rm -r /var/lib/apt/lists/* &&
docker-php-ext-install -j$(nproc) recode
RUN apt-get update &&
apt-get install -y --no-install-recommends firebird-dev &&
rm -r /var/lib/apt/lists/* &&
docker-php-ext-install -j$(nproc) pdo_firebird
RUN apt-get update &&
apt-get install -y --no-install-recommends freetds-dev &&
rm -r /var/lib/apt/lists/* &&
docker-php-ext-configure pdo_dblib --with-libdir=lib/x86_64-linux-gnu &&
docker-php-ext-install -j$(nproc) pdo_dblib
RUN apt-get update &&
apt-get install -y --no-install-recommends libldap2-dev &&
rm -r /var/lib/apt/lists/* &&
docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu &&
docker-php-ext-install -j$(nproc) ldap
RUN apt-get update &&
apt-get install -y --no-install-recommends libc-client-dev libkrb5-dev &&
rm -r /var/lib/apt/lists/* &&
docker-php-ext-configure imap --with-kerberos --with-imap-ssl &&
docker-php-ext-install -j$(nproc) imap
RUN apt-get update &&
apt-get install -y --no-install-recommends firebird-dev &&
rm -r /var/lib/apt/lists/* &&
docker-php-ext-install -j$(nproc) interbase
RUN apt-get update &&
apt-get install -y --no-install-recommends libicu-dev &&
rm -r /var/lib/apt/lists/* &&
docker-php-ext-install -j$(nproc) intl
RUN apt-get update && \
apt-get install -y --no-install-recommends libmcrypt-dev &&
rm -r /var/lib/apt/lists/* &&
pecl install mcrypt-1.0.1 &&
docker-php-ext-enable mcrypt
RUN export CFLAGS=" PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" &&
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
RUN apt-get update && \
apt-get install -y --no-install-recommends zlib1g-dev libmemcached-dev &&
rm -r /var/lib/apt/lists/* &&
pecl install memcached &&
docker-php-ext-enable memcached
RUN pecl install redis-4.0.1 && docker-php-ext-enable redis
RUN docker-php-ext-configure opcache --enable-opcache && docker-php-ext-install opcache
RUN set -ex;
docker-php-source extract;
echo '# https://github.com/docker-library/php/issues/103#issuecomment-271413933' ;
echo 'AC_DEFUN([PHP_ALWAYS_SHARED],[])dnl';
echo;
cat /usr/src/php/ext/odbc/config.m4;
> temp.m4;
mv temp.m4 /usr/src/php/ext/odbc/config.m4;
apt-get update;
apt-get install -y --no-install-recommends unixodbc-dev;
rm -rf /var/lib/apt/lists/*;
docker-php-ext-configure odbc --with-unixODBC=shared,/usr;
docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr;
docker-php-ext-install odbc pdo_odbc;
docker-php-source delete
LABEL Author="Leo"
LABEL Version="1.0.25-fpm"
LABEL Description="PHP FPM 7.2 镜像. All extensions."
以上是关于Docker PHP 安装扩展汇总的主要内容,如果未能解决你的问题,请参考以下文章