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
你可以发布你的Dockerfile吗?你是从“apt-get update”开始的吗?你使用哪种发行版(Ubuntu,Debian,Centos,Alpine ......)? – user2915097
也许首先尝试一下'RUN apt-get update'。我对Docker自己很陌生,但是我相信如果你看看'docker ps'的输出,你可以连接到docker镜像'sudo docker exec -it bash',然后手动安装过程直到你得到它的工作。 –
我已更新使用的Docker文件。是的,我也更新了。此外,我使用相同的dockerFile为多个其他图像,他们曾经很好地工作。我只是在创建这张新图片时才开始面对这个问题。 –