2015-09-27 41 views
0

我有以下Dockerfile错误而试图建立custome Postgres的码头工人形象

FROM ubuntu:14.04 
MAINTAINER Mike Dillon <[email protected]> 

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 

构建步骤失败7.为什么我得到这个错误,我能做些什么来克服它?

谢谢。

亚历-Z。

+0

你是否在代理后面运行build命令? – BMW

+0

@宝马你是什么意思? –

回答

1

您正在尝试使用PPA ppa:ubuntugis/ppa。当您在执行apt-get update时,apt-get正试图从此新来源获取可用数据包的列表。但是,这个PPA很久没有更新,因此没有可用于您正在使用的Ubuntu版本的软件包,trusty 14.4

这里是Ubuntu的版本可用于该PPA名单:http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/dists/

您可以从旧版本的Ubuntu(FROM ubuntu:12.04)开始,或找到其他来源提供的包和postgis您需要的版本。

相关问题