在DigitalOcean Droplet上托管的基于Debian的Docker映像上,apt-get更新失败

时间:2018-06-25 16:34:39

标签: docker digital-ocean

我的Docker映像基于mongo:3.6.5,并且我正在其上运行命令apt-get update。当它在我的本地计算机上成功执行时,在尝试将其托管在Ubuntu 16.04 DigitalOcean Droplet上后,出现以下错误消息。

root@93c75f4d76a9:/# apt-get update
Err http://security.debian.org jessie/updates InRelease

Err http://security.debian.org jessie/updates Release.gpg
  Unable to connect to security.debian.org:http:
Err http://deb.debian.org jessie InRelease

Err http://deb.debian.org jessie-updates InRelease

Err http://deb.debian.org jessie Release.gpg
  Unable to connect to deb.debian.org:http: [IP: 5.153.231.4 80]
Err http://deb.debian.org jessie-updates Release.gpg
  Unable to connect to deb.debian.org:http: [IP: 5.153.231.4 80]
Err http://repo.mongodb.org jessie/mongodb-org/3.6 InRelease

Err http://repo.mongodb.org jessie/mongodb-org/3.6 Release.gpg
  Unable to connect to repo.mongodb.org:http:
Reading package lists... Done
W: Failed to fetch http://deb.debian.org/debian/dists/jessie/InRelease

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/InRelease

W: Failed to fetch http://security.debian.org/debian-security/dists/jessie/updates/InRelease

W: Failed to fetch http://repo.mongodb.org/apt/debian/dists/jessie/mongodb-org/3.6/InRelease

W: Failed to fetch http://security.debian.org/debian-security/dists/jessie/updates/Release.gpg  Unable to connect to security.debian.org:http:

W: Failed to fetch http://deb.debian.org/debian/dists/jessie/Release.gpg  Unable to connect to deb.debian.org:http: [IP: 5.153.231.4 80]

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/Release.gpg  Unable to connect to deb.debian.org:http: [IP: 5.153.231.4 80]

W: Failed to fetch http://repo.mongodb.org/apt/debian/dists/jessie/mongodb-org/3.6/Release.gpg  Unable to connect to repo.mongodb.org:http:

W: Some index files failed to download. They have been ignored, or old ones used instead.

我发现了类似的问题,并尝试通过添加来更改/etc/resolv.conf文件中的名称服务器

nameserver 8.8.8.8
nameserver 4.2.2.2

我试图找到并编辑此小滴上不存在的/etc/apt/sources.list文件。

还尝试禁用here中提到的ufw服务,该服务在该小滴上也不存在。

我还使用了node:8.11.3中的docker镜像,该镜像也是基于Debian的,并试图执行相同的apt-get update命令,但有相同的错误。

即使使用docker system prune -a删除了所有docker镜像并重新下载以避免生成缓存,也找不到任何救援方法。

在此特定情况下的任何解决方法将不胜感激。预先感谢。

0 个答案:

没有答案