我试图理解为什么我无法apt-get update从 docker 容器内运行debian:latest或ubuntu:latest.
ping 8.8.8.8从容器内或其他地址ping google.com从容器内或其他域apt-get update如果我用以下命令启动容器就可以了--network hostapt-get updatebridge如果容器连接到默认网络或任何其他用户定义的网络且适配器设置为桥接,则不起作用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)