尝试构buildcustome postgres Docker镜像时出错

我有以下的Dockerfile

FROM ubuntu:14.04 MAINTAINER Mike Dillon <mike@appropriate.io> ENV POSTGIS_MAJOR 2.1 ENV POSTGIS_VERSION 2.1.7+dfsg-3~94.git954a8d0.pgdg80+1 RUN apt-get install -y software-properties-common RUN add-apt-repository -y ppa:ubuntugis/ppa # temporary instruction, i beleive all the apt-get etc commands will need to be RUN in th$ # RUN -t -i ubuntu:14.04 /bin/bash RUN apt-get install -y postgresql-client RUN apt-get update && apt-get install -y --no-install-recommends postgresql-$PG_MAJOR-pos$ #RUN apt-get update && apt-get install -y --no-install-recommends postgresql-$PG_MAJOR-p$ #postgis=$POSTGIS_VERSION && rm -rf /var/lib/apt/lists/* RUN mkdir -p /docker-entrypoint-initdb.d 

当我运行这个Dockerfile时,我得到了第7步的以下结果:

 Step 7 : RUN apt-get update && apt-get install -y --no-install-recommends postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION postgis=$POSTGIS_VERSION && rm -rf /var/lib/apt/lists/* ---> Running in 8b0e852f7999 Ign http://ppa.launchpad.net trusty InRelease Ign http://archive.ubuntu.com trusty InRelease Ign http://ppa.launchpad.net trusty Release.gpg Ign http://archive.ubuntu.com trusty-updates InRelease Ign http://ppa.launchpad.net trusty Release Ign http://archive.ubuntu.com trusty-security InRelease Err http://ppa.launchpad.net trusty/main amd64 Packages Hit http://archive.ubuntu.com trusty Release.gpg Err http://ppa.launchpad.net trusty/main amd64 Packages Err http://ppa.launchpad.net trusty/main amd64 Packages Get:1 http://archive.ubuntu.com trusty-updates Release.gpg [933 B] Err http://ppa.launchpad.net trusty/main amd64 Packages Get:2 http://archive.ubuntu.com trusty-security Release.gpg [933 B] Err http://ppa.launchpad.net trusty/main amd64 Packages 404 Not Found Hit http://archive.ubuntu.com trusty Release Get:3 http://archive.ubuntu.com trusty-updates Release [63.5 kB] Get:4 http://archive.ubuntu.com trusty-security Release [63.5 kB] Get:5 http://archive.ubuntu.com trusty/main Sources [1335 kB] Get:6 http://archive.ubuntu.com trusty/restricted Sources [5335 B] Get:7 http://archive.ubuntu.com trusty/universe Sources [7926 kB] Get:8 http://archive.ubuntu.com trusty/main amd64 Packages [1743 kB] Get:9 http://archive.ubuntu.com trusty/restricted amd64 Packages [16.0 kB] Get:10 http://archive.ubuntu.com trusty/universe amd64 Packages [7589 kB] Get:11 http://archive.ubuntu.com trusty-updates/main Sources [296 kB] Get:12 http://archive.ubuntu.com trusty-updates/restricted Sources [4521 B] Get:13 http://archive.ubuntu.com trusty-updates/universe Sources [174 kB] Get:14 http://archive.ubuntu.com trusty-updates/main amd64 Packages [782 kB] Get:15 http://archive.ubuntu.com trusty-updates/restricted amd64 Packages [22.7 kB] Get:16 http://archive.ubuntu.com trusty-updates/universe amd64 Packages [415 kB] Get:17 http://archive.ubuntu.com trusty-security/main Sources [121 kB] Get:18 http://archive.ubuntu.com trusty-security/restricted Sources [1874 B] Get:19 http://archive.ubuntu.com trusty-security/universe Sources [35.4 kB] Get:20 http://archive.ubuntu.com trusty-security/main amd64 Packages [434 kB] Get:21 http://archive.ubuntu.com trusty-security/restricted amd64 Packages [14.8 kB] Get:22 http://archive.ubuntu.com trusty-security/universe amd64 Packages [151 kB] Fetched 21.2 MB in 1min 30s (233 kB/s) W: Failed to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/dists/trusty/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 update && apt-get install -y --no-install-recommends postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION postgis=$POSTGIS_VERSION && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100 

构build失败,在第7步。为什么我得到这个错误,我能做些什么来克服它?

谢谢。

亚历克斯-Z。

您正尝试使用PPA ppa:ubuntugis/ppa 。 在进行apt-get updateapt-get会尝试从这个新来源获取可用数据包的列表。 但是,这个PPA还没有被更新很久,因此没有可用的版本的Ubuntu, trusty 14.4的版本trusty 14.4

以下是可用于此PPA的ubuntu版本列表: http : //ppa.launchpad.net/ubuntugis/ppa/ubuntu/dists/

你可以从一个较旧的ubuntu版本( FROM ubuntu:12.04 )开始,或者find另一个提供你需要的软件包和版本的postgis