无法通过Docker Build来安装PHP Zip模块

我遇到了Docker镜像的问题。 我正在使用FROM ubuntu:16.04的基础映像,并在其上安装以下软件包:

 RUN apt-get -y install apache2 RUN apt-get -y install php7.0 RUN apt-get -y install libapache2-mod-php7.0 RUN apt-get -y install php7.0-mysql RUN apt-get -y install php7.0-gd RUN apt-get -y install php-pear RUN apt-get -y install php7.0-curl RUN apt-get -y install php7.0-mbstrin RUN apt-get -y install php-imagick RUN apt-get -y install curl RUN apt-get -y install lynx-cur RUN apt-get -y install php7.0-zip #RUN apt-get -y install php7.0-xsl 

php7.0-zip ,我需要安装php7.0-zip软件包,但要做一个docker build -t [...] . 与上面的包注释结果在一个没有安装/启用zip的图像。 在指挥期间没有任何错误,一眼看来,一切似乎都没有问题。

查看命令的输出,我可以看到它正在正确下载并尝试安装libzip4ziplibzip4zlib ,是一个与php7.0-zip一起安装的依赖项):

 The following NEW packages will be installed: libzip4 php7.0-zip 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. Need to get 56.1 kB of archives. After this operation, 186 kB of additional disk space will be used. Get:1 http://archive.ubuntu.com/ubuntu xenial/universe amd64 libzip4 amd64 1.0.1-0ubuntu1 [36.3 kB] Get:2 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 php7.0-zip amd64 7.0.15-0ubuntu0.16.04.4 [19.9 kB] debconf: delaying package configuration, since apt-utils is not installed Fetched 56.1 kB in 0s (123 kB/s) Selecting previously unselected package libzip4:amd64. (Reading database ... 13491 files and directories currently installed.) Preparing to unpack .../libzip4_1.0.1-0ubuntu1_amd64.deb ... Unpacking libzip4:amd64 (1.0.1-0ubuntu1) ... Selecting previously unselected package php7.0-zip. Preparing to unpack .../php7.0-zip_7.0.15-0ubuntu0.16.04.4_amd64.deb ... Unpacking php7.0-zip (7.0.15-0ubuntu0.16.04.4) ... Processing triggers for libapache2-mod-php7.0 (7.0.15-0ubuntu0.16.04.4) ... Processing triggers for php7.0-fpm (7.0.15-0ubuntu0.16.04.4) ... invoke-rc.d: could not determine current runlevel invoke-rc.d: policy-rc.d denied execution of restart. Setting up libzip4:amd64 (1.0.1-0ubuntu1) ... Setting up php7.0-zip (7.0.15-0ubuntu0.16.04.4) ... debconf: unable to initialize frontend: Dialog debconf: (TERM is not set, so the dialog frontend is not usable.) debconf: falling back to frontend: Readline Creating config file /etc/php/7.0/mods-available/zip.ini with new version Processing triggers for libc-bin (2.23-0ubuntu7) ... Processing triggers for libapache2-mod-php7.0 (7.0.15-0ubuntu0.16.04.4) ... Processing triggers for php7.0-fpm (7.0.15-0ubuntu0.16.04.4) ... invoke-rc.d: could not determine current runlevel invoke-rc.d: policy-rc.d denied execution of restart. ---> fe12c0bd06fd Removing intermediate container 7cadeb2256d0 

有几个通知,但没有任何失败。 在推送到gcloud并下载到本地项目后,configuration并连接到映像后运行phpinfo()将导致以下结果:

在这里输入图像说明

在这个图像中,没有启用zip模块。 作为参考,另一个启用zip的PHP本地安装显示如下:

在这里输入图像说明

我已经试过按照相同的步骤( php7.0-xsl )安装另一个包装,configuration和连接后, xsl模块显示为在phpinfo()启用:

在这里输入图像说明

有没有人曾经遇到过这种情况? 我不知道为什么zip不安装,我不知所措…我需要与excel相关的function的zip模块,但我不知道下一步该怎么做。 任何build议将不胜感激。

如果我的整个Dockerfile是必需的,我会更新。