Fpm dockerfile build problem

  docker, question

The following is my dockerfile file.

FROM php:7.1-fpm
 
 RUN apt-get update -y \
 && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev zlib1g-dev libcurl3 libwebp-dev zlib1g \
 && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-webp-dir=/usr/include/ --with-png-dir=/usr/include \
 && docker-php-ext-install -j$(nproc) gd \
 ##
 && apt-get install -y libicu-dev \
 && docker-php-ext-install -j$(nproc) intl \
 ##
 && apt-get install -y libbz2-dev \
 && docker-php-ext-install bz2 \
 ##
 && apt-get install -y libxml2-dev \
 && apt-get install -y libxslt-dev \
 && docker-php-ext-install soap \
 && docker-php-ext-install xsl \
 && docker-php-ext-install xmlrpc \
 && docker-php-ext-install wddx \
 ##
 && docker-php-ext-install zip \
 && docker-php-ext-install pcntl \
 && docker-php-ext-install opcache \
 && docker-php-ext-install pdo \
 && docker-php-ext-install pdo_mysql \
 && docker-php-ext-install mysqli \
 && docker-php-ext-install mbstring \
 && docker-php-ext-install sockets \
 ##
 && pecl install redis-3.1.3 \
 && docker-php-ext-enable --ini-name pecl.ini redis  \
 ##
 && cd /tmp \
 && curl -L -s -o  cphalcon.tar.gz  https://github.com/phalcon/cphalcon/archive/v3.4.0.tar.gz \
 && tar xzvf  cphalcon.tar.gz \
 && cd /tmp/cphalcon-3.4.0/build \
 && ./install \
 && echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/phalcon.ini \
 ##
 && cd /tmp \
 && curl -L -s -o  swoole.tar.gz  https://github.com/swoole/swoole-src/archive/v2.1.0.tar.gz \
 && tar xzvf  swoole.tar.gz \
 && cd /tmp/swoole-src-2.1.0 \
 && phpize \
 && ./configure \
 && make && make install \
 && echo "extension=swoole.so" > /usr/local/etc/php/conf.d/swoole.ini \
 ##
 && cd /tmp \
 && rm -rf cphalcon* \
 && rm -rf swoole* \
 && rm -rf package*
 
 EXPOSE 9000
 CMD ["php-fpm"]

There is no problem with building like this, but it is very slow because there is apt-get update in it, so google said it can use domestic sources and then change it to the following:

FROM php:7.1-fpm
 
 COPY ./sources.list .
 
 RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak && mv sources.list /etc/apt/ && apt-get update -y \
 && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev zlib1g-dev libcurl3 libwebp-dev zlib1g \
 ......

The sources.list file reads as follows:

deb  http://mirrors.163.com/debian/ jessie main non-free contrib
 deb  http://mirrors.163.com/debian/ jessie-updates main non-free contrib
 deb  http://mirrors.163.com/debian/ jessie-backports main non-free contrib
 deb-src  http://mirrors.163.com/debian/ jessie main non-free contrib
 deb-src  http://mirrors.163.com/debian/ jessie-updates main non-free contrib
 deb-src  http://mirrors.163.com/debian/ jessie-backports main non-free contrib
 deb  http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib
 deb-src  http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib

If this child build, will report an error:

The following information may help to resolve the situation:
 
 The following packages have unmet dependencies:
 libfreetype6-dev : Depends: zlib1g-dev but it is not going to be installed or
 libz-dev
 libpng12-dev : Depends: zlib1g-dev but it is not going to be installed
 E: Unable to correct problems, you have held broken packages.

I wonder if there is a problem with the source of 163? But it shouldn’t be,

Ask for help, how can this problem be solved?

http://www.cnblogs.com/ssjt/a …It seems to be a similar problem. Try to replace it with the source of HKUST