2016-03-15 68 views
0

在docker中創建我的ubuntu鏡像時,需要包libwww-perl。 所以在我的泊塢文件,我增加了行在嘗試安裝libwww-perl時構建Docker鏡像會導致錯誤,即,perl-modules_5.14.2-6和perl_5.14.2-6未找到

RUN apt-get install -y libwww-perl

然而,當我試圖建立這個碼頭工人形象

sudo docker build -t web-service:latest .

我結束了以下錯誤。

錯誤:

Step 3 : RUN apt-get install -y libwww-perl 
---> Running in 5c6c1fdd3b66 
Reading package lists... 
Building dependency tree... 
Reading state information... 
The following extra packages will be installed: 
    libclass-isa-perl libencode-locale-perl libfile-listing-perl 
    libfont-afm-perl libhtml-form-perl libhtml-format-perl libhtml-parser-perl 
    libhtml-tagset-perl libhtml-tree-perl libhttp-cookies-perl 
    libhttp-daemon-perl libhttp-date-perl libhttp-message-perl 
    libhttp-negotiate-perl libio-socket-inet6-perl libio-socket-ssl-perl 
    liblwp-mediatypes-perl liblwp-protocol-https-perl libmailtools-perl 
    libnet-http-perl libnet-ssleay-perl libsocket6-perl libswitch-perl 
    libtimedate-perl liburi-perl libwww-robotrules-perl perl perl-modules 
Suggested packages: 
    libdata-dump-perl libcrypt-ssleay-perl libmime-base64-perl 
    libauthen-ntlm-perl perl-doc libterm-readline-gnu-perl 
    libterm-readline-perl-perl libpod-plainer-perl 
The following NEW packages will be installed: 
    libclass-isa-perl libencode-locale-perl libfile-listing-perl 
    libfont-afm-perl libhtml-form-perl libhtml-format-perl libhtml-parser-perl 
    libhtml-tagset-perl libhtml-tree-perl libhttp-cookies-perl 
    libhttp-daemon-perl libhttp-date-perl libhttp-message-perl 
    libhttp-negotiate-perl libio-socket-inet6-perl libio-socket-ssl-perl 
    liblwp-mediatypes-perl liblwp-protocol-https-perl libmailtools-perl 
    libnet-http-perl libnet-ssleay-perl libsocket6-perl libswitch-perl 
    libtimedate-perl liburi-perl libwww-perl libwww-robotrules-perl perl 
    perl-modules 
0 upgraded, 29 newly installed, 0 to remove and 12 not upgraded. 
Need to get 9092 kB of archives. 
After this operation, 36.5 MB of additional disk space will be used. 
Get:1 http://archive.ubuntu.com/ubuntu/ precise/main libclass-isa-perl all 0.36-3 [11.9 kB] 
Get:2 http://archive.ubuntu.com/ubuntu/ precise/main libswitch-perl all 2.16-2 [19.2 kB] 
Get:3 http://archive.ubuntu.com/ubuntu/ precise/main libencode-locale-perl all 1.02-2 [12.0 kB] 
Get:4 http://archive.ubuntu.com/ubuntu/ precise/main libtimedate-perl all 1.2000-1 [41.6 kB] 
Get:5 http://archive.ubuntu.com/ubuntu/ precise/main libhttp-date-perl all 6.00-1 [10.1 kB] 
Get:6 http://archive.ubuntu.com/ubuntu/ precise/main libfile-listing-perl all 6.03-1 [9690 B] 
Get:7 http://archive.ubuntu.com/ubuntu/ precise/main libfont-afm-perl all 1.20-1 [14.3 kB] 
Get:8 http://archive.ubuntu.com/ubuntu/ precise/main liburi-perl all 1.59-1 [90.3 kB] 
Get:9 http://archive.ubuntu.com/ubuntu/ precise/main libhtml-tagset-perl all 3.20-2 [13.5 kB] 
Get:10 http://archive.ubuntu.com/ubuntu/ precise/main libhtml-parser-perl amd64 3.69-1build1 [97.3 kB] 
Get:11 http://archive.ubuntu.com/ubuntu/ precise/main liblwp-mediatypes-perl all 6.01-1 [17.5 kB] 
Get:12 http://archive.ubuntu.com/ubuntu/ precise/main libhttp-message-perl all 6.01-1 [77.6 kB] 
Get:13 http://archive.ubuntu.com/ubuntu/ precise/main libhtml-form-perl all 6.00-1 [22.8 kB] 
Get:14 http://archive.ubuntu.com/ubuntu/ precise/main libhtml-tree-perl all 4.2-1 [205 kB] 
Get:15 http://archive.ubuntu.com/ubuntu/ precise/main libhtml-format-perl all 2.10-1 [40.6 kB] 
Get:16 http://archive.ubuntu.com/ubuntu/ precise/main libhttp-cookies-perl all 6.00-2 [23.3 kB] 
Get:17 http://archive.ubuntu.com/ubuntu/ precise/main libhttp-daemon-perl all 6.00-1 [16.7 kB] 
Get:18 http://archive.ubuntu.com/ubuntu/ precise/main libhttp-negotiate-perl all 6.00-2 [13.4 kB] 
Get:19 http://archive.ubuntu.com/ubuntu/ precise/main libsocket6-perl amd64 0.23-1build2 [21.9 kB] 
Get:20 http://archive.ubuntu.com/ubuntu/ precise/main libio-socket-inet6-perl all 2.69-2 [14.3 kB] 
Get:21 http://archive.ubuntu.com/ubuntu/ precise/main libnet-ssleay-perl amd64 1.42-1build1 [188 kB] 
Get:22 http://archive.ubuntu.com/ubuntu/ precise/main libio-socket-ssl-perl all 1.53-1 [47.5 kB] 
Get:23 http://archive.ubuntu.com/ubuntu/ precise/main libnet-http-perl all 6.02-1 [23.5 kB] 
Get:24 http://archive.ubuntu.com/ubuntu/ precise/main libwww-robotrules-perl all 6.01-1 [14.1 kB] 
Get:25 http://archive.ubuntu.com/ubuntu/ precise/main libwww-perl all 6.03-1 [156 kB] 
Get:26 http://archive.ubuntu.com/ubuntu/ precise/main liblwp-protocol-https-perl all 6.02-1 [6746 B] 
Get:27 http://archive.ubuntu.com/ubuntu/ precise/main libmailtools-perl all 2.08-1 [84.0 kB] 
Err http://archive.ubuntu.com/ubuntu/ precise-security/main perl-modules all 5.14.2-6ubuntu2.4 
    404 Not Found [IP: 91.189.88.153 80] 
Err http://archive.ubuntu.com/ubuntu/ precise-security/main perl amd64 5.14.2-6ubuntu2.4 
    404 Not Found [IP: 91.189.88.153 80] 
Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/p/perl/perl-modules_5.14.2-6ubuntu2.4_all.deb 404 Not Found [IP: 91.189.88.153 80] 
Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/p/perl/perl_5.14.2-6ubuntu2.4_amd64.deb 404 Not Found [IP: 91.189.88.153 80] 
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? 
Fetched 1293 kB in 8s (145 kB/s) 
The command '/bin/sh -c apt-get install -y libwww-perl' returned a non-zero code: 100 

然而,當我嘗試在我的本地機器上運行Ubuntu手動運行該命令,它工作正常。 apt-get install -y libwww-perl

任何想法是什麼問題?

更新: 我泊塢窗文件內容 -

FROM dockerhub.corp.comp.com/idp/docker-jvm-8 
MAINTAINER [email protected] 

RUN apt-get update 
RUN apt-get install -y libwww-perl 

ENV basedir /opt/comp/apps/web-service 
ENV libdir ${basedir}/lib 
ENV confdir ${basedir}/conf 
ENV bindir ${basedir}/bin 
ENV logdir /opt/comp/logs/web-service 

RUN mkdir -p ${libdir} ${confdir} ${logdir} 
RUN chown -R nobody:nogroup ${libdir} 
RUN chown -R nobody:nogroup ${confdir} 
RUN chown -R nobody:nogroup ${logdir} 


ADD setup.sh ${bindir}/setup.sh 
ADD service_start.sh /tmp/service_start.sh 
ADD healthcheck.pl /tmp/healthcheck.pl 

RUN cd /tmp && mkdir test_config && mv config.jar test_config/config.jar && cd test_config && jar -xvf config.jar && rm config.jar 
RUN cd /tmp && mkdir test_env && mv env.jar test_env/env.jar && cd test_env && jar -xvf env.jar && rm env.jar 

RUN chown -R nobody:nogroup ${bindir} 
RUN chmod -R +x ${bindir}/setup.sh 

EXPOSE 11040 
+0

你可以發佈你的Dockerfile嗎?你是從「apt-get update」開始的嗎?你使用哪種發行版(Ubuntu,Debian,Centos,Alpine ......)? – user2915097

+0

也許首先嚐試一下'RUN apt-get update'。我對Docker自己很陌生,但是我相信如果你看看'docker ps'的輸出,你可以連接到docker鏡像'sudo docker exec -it bash',然後手動安裝過程直到你得到它的工作。 –

+0

我已更新使用的Docker文件。是的,我也更新了。此外,我使用相同的dockerFile爲多個其他圖像,他們曾經很好地工作。我只是在創建這張新圖片時纔開始面對這個問題。 –

回答

0

貌似問題是下載的Linux映像。 使用圖像的另一個版本,並加入

RUN apt-get update 

線甚至對我現有的DockerFile(現在一直工作到)其他所有運行命令之前之後固定的問題。

但我仍然不確定這些現有的DockerFile如何工作到現在。

相關問題