centos7 php-apache镜像添加redis/memcache/gd/mysql_pdo/mysqli/imagick
Posted on 2019-01-14 10:04 懒人ABC 阅读(383) 评论(1) 编辑 收藏 举报FROM php:5.6-apache-stretch
RUN /usr/local/bin/docker-php-ext-install mysqli pdo_mysql; \
&& a2enmod rewrite; \
&& mkdir -p /usr/src/php/ext \
&& cd /usr/src/php/ext \
&& curl -L -o /usr/src/php/ext/phpredis-4.2.0.tar.gz https://github.com/phpredis/phpredis/archive/4.2.0.tar.gz \
&& tar xfz phpredis-4.2.0.tar.gz \
&& rm -r phpredis-4.2.0.tar.gz \
&& mv phpredis-4.2.0 /usr/src/php/ext/redis \
&& /usr/local/bin/docker-php-ext-install redis \
&& curl -O https://launchpadlibrarian.net/165454254/libmemcached-1.0.18.tar.gz \
&& tar zxvf libmemcached-1.0.18.tar.gz \
&& mv libmemcached-1.0.18 libmemcached \
&& cd libmemcached \
&& ./configure --with-memcached --disable-memcached-sasl \
&& make && make install \
&& cd ../ \
&& curl -L -o /usr/src/php/ext/zlib-1.2.11.tar.gz http://www.zlib.net/fossils/zlib-1.2.11.tar.gz \
&& tar xfz zlib-1.2.11.tar.gz \
&& rm -r zlib-1.2.11.tar.gz \
&& mv zlib-1.2.11 /usr/src/php/ext/zlib \
&& cd zlib \
&& ./configure \
&& make && make install \
&& curl -L -o /usr/src/php/ext/memcached-2.2.0.tgz http://pecl.php.net/get/memcached-2.2.0.tgz \
&& tar xfz memcached-2.2.0.tgz \
&& rm -r memcached-2.2.0.tgz \
&& mv memcached-2.2.0 /usr/src/php/ext/memcached \
&& cd memcached \
&& ./configure --disable-memcached-sasl \
&& /usr/local/bin/docker-php-ext-install memcached \
&& apt-get update \
&& apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng-dev \
libmagickwand-dev libmagickcore-dev imagemagick \
&& /usr/local/bin/docker-php-ext-install -j$(nproc) iconv mcrypt \
&& /usr/local/bin/docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& /usr/local/bin/docker-php-ext-install -j$(nproc) gd \
&& pecl install imagick-3.4.3 \
&& /usr/local/bin/docker-php-ext-enable imagick