添加扩展的dockerfile:


FROM php:5.6-fpm

ENV TZ=Asia/Shanghai

RUN set -xe \

# "构建依赖"

    && buildDeps=" \

        git \

        build-essential \

        php5-dev \

        php5-mysql \

php5-xmlrpc \

libxml2 \

libxml2-dev \

        libfreetype6-dev \

        libjpeg62-turbo-dev \

        libmcrypt-dev \

        libpng12-dev \

        libpcre3-dev \

    " \

# "安装 php 以及编译构建组件所需包"

    && groupadd www \

    && useradd -s /sbin/nologin -g www www \

    && apt-get update \

    && apt-get install -y ${buildDeps} --no-install-recommends \

   && pecl install memcached \

# "编译安装 php 组件"

    && docker-php-ext-install iconv mcrypt mysqli pdo pdo_mysql zip soap sockets xmlrpc \

    && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \

    && docker-php-ext-install gd \

  # 编译、安装 phalcon

   && git clone --depth=1 git://github.com/phalcon/cphalcon.git \ 

   && cd /usr/local/cphalcon/build \

    && ./install \

    && cd ../.. \

    && rm -rf cphalcon \

    && docker-php-ext-enable phalcon soap sockets xmlrpc \

   && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone


#    && docker-php-ext-enable phalcon soap sockets xmlrpc

# "清理"

#    && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false $buildDeps \

#    && rm -rf /var/cache/apt/* \

#    && rm -rf /var/lib/apt/lists/*