Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
apt get update在docker容器内不起作用_Docker_Boot2docker_Dockerfile_Docker Compose_Dockerhub - Fatal编程技术网

apt get update在docker容器内不起作用

apt get update在docker容器内不起作用,docker,boot2docker,dockerfile,docker-compose,dockerhub,Docker,Boot2docker,Dockerfile,Docker Compose,Dockerhub,我使用ubuntu:14.04创建了这个容器。 我已经在docker文件配置中设置了代理。 当我启动conatiner并键入命令apt get update时,它给了我一个错误 root@4a7043e2f675:/# apt-get update 0%[连接到archive.ubuntu.com] 将在此处和之后停留一段时间,给出如下错误: Err http://archive.ubuntu.com trusty InRelease Err http://archive.ubuntu.co

我使用ubuntu:14.04创建了这个容器。 我已经在docker文件配置中设置了代理。 当我启动conatiner并键入命令apt get update时,它给了我一个错误

root@4a7043e2f675:/# apt-get update
0%[连接到archive.ubuntu.com] 将在此处和之后停留一段时间,给出如下错误:

Err http://archive.ubuntu.com trusty InRelease Err http://archive.ubuntu.com trusty Release.gpg Could not resolve 'archive.ubuntu.com' Reading package lists... Done W: Failed to fetch http:// archive.ubuntu.com/ubuntu/dists/trusty/InRelease W: Failed to fetch http:// archive.ubuntu.com/ubuntu/dists/trusty/Release.gpg Could not resolve 'archive.ubuntu.com' W: Some index files failed to download. They have been ignored, or old ones used instead. 犯错误http://archive.ubuntu.com 可靠的恢复 犯错误http://archive.ubuntu.com trusty Release.gpg 无法解析“archive.ubuntu.com” 正在阅读软件包列表。。。多恩 W:无法获取http://archive.ubuntu.com/ubuntu/dists/trusty/InRelease W:无法获取http://archive.ubuntu.com/ubuntu/dists/trusty/Release.gpg无法解析“archive.ubuntu.com” W:一些索引文件下载失败。它们被忽略了,或者使用了旧的。
请为我提供解决方案人员。

人员我的问题已通过容器中的导出代理解决。但我仍然不明白为什么他们需要在容器中设置代理,因为基本映像和/etc/default/docker文件中已经设置了代理。

也许您可以出于任何原因添加
Dockerfile
,您设置的代理无法正常工作,并且您的容器无法访问internet或dns。我的internet在基本映像中工作正常。此外,我还添加了/etc/default/docker HTTP\u PROXY和HTTPS\u PROXY。您没有向我们显示启动docker容器的命令。类似于docker run-it ubuntu:14.04。它是? Err http://archive.ubuntu.com trusty InRelease Err http://archive.ubuntu.com trusty Release.gpg Could not resolve 'archive.ubuntu.com' Reading package lists... Done W: Failed to fetch http:// archive.ubuntu.com/ubuntu/dists/trusty/InRelease W: Failed to fetch http:// archive.ubuntu.com/ubuntu/dists/trusty/Release.gpg Could not resolve 'archive.ubuntu.com' W: Some index files failed to download. They have been ignored, or old ones used instead.