anchor.diff:          libmcrypt-dev \
           curl \
           tar \
  -        xz
  -
  -# create user
  -RUN set -x \
  -    && addgroup -S -g 82 www \
  -    && adduser -S -D -H -G www -u 82 www
  -
  -# environment for php7
  -ENV PHP_VERSION 7.1.10
  -ENV PHP_HOME /usr/local/php7
  -ENV PHP_CONF_PATH /usr/local/php7/etc
  -
  -# fetch php
  -RUN mkdir -p "/usr/src" \
  -    && curl -SL "http://php.net/get/php-$PHP_VERSION.tar.gz/from/this/mirror" -o php.tar.gz \
  +        xz \
  +    \
  +    && mkdir -p "/usr/src" \
  +    && country=`wget -T1 -q -O- google.com 2>&1 | sed -nr 's/.*(timed\ out).*/China/p'` \
  +    && if [ "$country" == "China" ]; then \
  +           curl -SL "http://cn2.php.net/get/php-7.1.10.tar.gz/from/this/mirror" -o php.tar.gz; \
  +       else \
  +           curl -SL "http://php.net/get/php-$PHP_VERSION.tar.gz/from/this/mirror" -o php.tar.gz; \
  +       fi; \
  +    unset country \
       && tar xvf php.tar.gz -C /usr/src \
  -    && rm -rf php.tar.gz
  -
  -# build php
  -RUN mkdir -p "$PHP_HOME" \
  +    && rm -rf php.tar.gz \
  +    \
  +    && mkdir -p "$PHP_HOME" \
       && mkdir -p "$PHP_CONF_PATH/conf.d" \
       && export CFLAGS="-fstack-protector-strong -fpic -fpie -O2" \
       && export CPPFLAGS="-fstack-protector-strong -fpic -fpie -O2" \
       && LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie" \
  -    && apk add --no-cache --virtual .runtime-deps \
  +    && apk add --virtual .runtime-deps \
  +        ca-certificates \
           openssl \
  -        ca-certificates \
  +    \
       && cd "/usr/src/php-$PHP_VERSION" \
       && ./configure \
           --build="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
  
positive.code:     && cd "$PHP_HOME" \
      && rm -rf "/usr/src/php-$PHP_VERSION" \
      && { find . -type f -perm +0111 -exec strip --strip-all {} + || true; } \
      && apk del .build-deps
  
negative.code: # author info
  MAINTAINER Wang <shadowman@shellboot.com>
  
  # China mirrors and create www-user
  RUN set -x \
      && country=`wget -T1 -q -O- google.com 2>&1 | sed -nr 's/.*(timed\ out).*/China/p'` \
      && if [ "$country" == "China" ]; then \
             echo 'http://mirrors.ustc.edu.cn/alpine/v3.6/main' > /etc/apk/repositories; \
             echo 'http://mirrors.ustc.edu.cn/alpine/v3.6/community' >> /etc/apk/repositories; \
         fi; \
      \
      addgroup -S -g 82 www \
      && adduser -S -D -H -G www -u 82 www
  
  # environment for php7
  ENV PHP_VERSION 7.1.10
  ENV PHP_HOME /usr/local/php7
  ENV PHP_CONF_PATH /usr/local/php7/etc
  
  # install deps and fetch/compile/install php
  RUN set -x \
      && apk update \
      && apk add --virtual .build-deps \
          autoconf \
          bison \
          dpkg \
  