yeszao / dnmp

Docker LNMP (Nginx, PHP7/PHP5, MySQL, Redis)

Home Page:https://resumis.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

run docker-compose -f docker-compose56.yml up and throw a error

yuzhiyuan opened this issue · comments

when I run docker-compose -f docker-compose56.yml up in the dnmp dir with mac os10.13 or centos 7 ,it throws a error ,like this:

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.
ERROR: Service 'php' failed to build: The command '/bin/sh -c apt-get update && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && docker-php-ext-install gd && : && apt-get install -y libicu-dev && docker-php-ext-install intl && : && 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 && : && apt-get install -y libbz2-dev && docker-php-ext-install bz2 && : && docker-php-ext-install zip && docker-php-ext-install pcntl && docker-php-ext-install pdo_mysql && docker-php-ext-install mysqli && docker-php-ext-install mbstring && docker-php-ext-install exif && docker-php-ext-install bcmath && docker-php-ext-install calendar && docker-php-ext-install sockets && docker-php-ext-install gettext && docker-php-ext-install shmop && docker-php-ext-install sysvmsg && docker-php-ext-install sysvsem && docker-php-ext-install sysvshm && docker-php-ext-install opcache' returned a non-zero code: 100

两个解决方法:
1、删除php/php56/Dockerfile中这一行:

COPY ./sources.list.jessie /etc/apt/sources.list

容器里面直接使用官方源,这样就是build的时候慢一些。
2、把php/php56/source.list.jesse的内容改为中科大的源:

deb http://mirrors.ustc.edu.cn/debian stable main contrib non-free
deb-src http://mirrors.ustc.edu.cn/debian stable main contrib non-free
deb http://mirrors.ustc.edu.cn/debian stable-proposed-updates main contrib non-free
deb-src http://mirrors.ustc.edu.cn/debian stable-proposed-updates main contrib non-free

这样速度会快很多。
试过163、阿里云、腾讯云、清华的源,都会报类似的错误,国内目前测试了这几个,只有中科大的源正常。

对,连官方的源都已经没用了。。