在docker php:7.0-apache里安装php7.0-pgsql

我尝试在我的php:7.0-apache映像中安装php7.0-pgsql。 我知道在互联网上有很多类似的问题,但我真的需要帮助:

FROM php:7.0-apache RUN apt-get -y update && \ apt-get -y install software-properties-common locales locales-all && \ LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php && \ apt-get -y update && \ apt-get -y install php7.0-pgsql COPY src/ /var/www/html 

在我的docker构build过程中出现以下错误:

 # LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php More info: https://launchpad.net/~ondrej/+archive/ubuntu/php gpg: keyring `/tmp/tmppxe6egn8/secring.gpg' created gpg: keyring `/tmp/tmppxe6egn8/pubring.gpg' created gpg: requesting key E5267A6C from hkp server keyserver.ubuntu.com gpg: /tmp/tmppxe6egn8/trustdb.gpg: trustdb created gpg: key E5267A6C: public key "Launchpad PPA for Ondřej Surý" imported gpg: Total number processed: 1 gpg: imported: 1 (RSA: 1) OK Hit http://security.debian.org jessie/updates InRelease Ign http://ppa.launchpad.net jessie InRelease Ign http://ppa.launchpad.net jessie Release.gpg Get:1 http://security.debian.org jessie/updates/main amd64 Packages [549 kB] Ign http://ppa.launchpad.net jessie Release Err http://ppa.launchpad.net jessie/main amd64 Packages Ign http://deb.debian.org jessie InRelease Err http://ppa.launchpad.net jessie/main amd64 Packages Hit http://deb.debian.org jessie-updates InRelease Hit http://deb.debian.org jessie Release.gpg Err http://ppa.launchpad.net jessie/main amd64 Packages Err http://ppa.launchpad.net jessie/main amd64 Packages Hit http://deb.debian.org jessie Release Err http://ppa.launchpad.net jessie/main amd64 Packages 404 Not Found Get:2 http://deb.debian.org jessie-updates/main amd64 Packages [17.8 kB] Get:3 http://deb.debian.org jessie/main amd64 Packages [9063 kB] Fetched 9630 kB in 11s (870 kB/s) W: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/dists/jessie/main/binary-amd64/Packages 404 Not Found E: Some index files failed to download. They have been ignored, or old ones used instead. The command '/bin/sh -c apt-get -y update && apt-get -y install software-properties-common locales locales-all && LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php && apt-get -y update && apt-get -y install php7.0-pgsql' returned a non-zero code: 100 

这里是我正在使用的一个Dockerfile的摘录

 FROM php:7.1-apache RUN apt-get update \ && apt-get install --no-install-recommends -y libpq-dev \ && docker-php-ext-install pgsql \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* 

我自己编译扩展,因为官方图像中的PHP也是从源代码编译而不是从Debian存储库中获取的。