小编Kla*_*aus的帖子

如果连接到桥接网络,则无法从 docker 容器内部进行 apt-get 更新

我试图理解为什么我无法apt-get update从 docker 容器内运行debian:latestubuntu:latest.

  • 我可以ping 8.8.8.8从容器内或其他地址
  • 我能够ping google.com从容器内或其他域
  • apt-get update如果我用以下命令启动容器就可以了--network host
  • apt-get updatebridge如果容器连接到默认网络或任何其他用户定义的网络且适配器设置为桥接,则不起作用
  • 主机是openstack管理的虚拟机
  • 一切都在我的计算机上按预期运行(不是 openstack,不是虚拟的)

apt-get update将超时:

root@66230c3e7572:/# apt update
Err:1 http://deb.debian.org/debian buster InRelease                           
  Connection failed [IP: 199.232.138.132 80]
Err:2 http://security.debian.org/debian-security buster/updates InRelease
  Connection failed [IP: 151.101.194.132 80]
Err:3 http://deb.debian.org/debian buster-updates InRelease              
  Connection failed [IP: 199.232.138.132 80]
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date. …
Run Code Online (Sandbox Code Playgroud)

networking ubuntu debian apt docker

8
推荐指数
1
解决办法
8461
查看次数

标签 统计

apt ×1

debian ×1

docker ×1

networking ×1

ubuntu ×1