我无法在任何Docker容器内执行任何需要Internet连接的命令。
作品:
docker run ubuntu /bin/echo 'Hello world'
不起作用:
docker run ubuntu apt-get update
Err:1 http://archive.ubuntu.com/ubuntu xenial InRelease
Temporary failure resolving 'archive.ubuntu.com'
Err:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
Temporary failure resolving 'archive.ubuntu.com'
Err:3 http://archive.ubuntu.com/ubuntu xenial-security InRelease
Temporary failure resolving 'archive.ubuntu.com'
Reading package lists...
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-security/InRelease Temporary failure resolving 'archive.ubuntu.com'
与pip
和类似ping
。
我在Ubuntu 16.04上,未使用防火墙或公司代理服务器,并尝试重新启动Docker。
更新:
交互模式下的更新以相同的方式失败。
docker exec -ti angry_goodall /bin/bash
apt-get update
#fails
ping google.com
#fails with "unknown host" message
ping 8.8.8.8
# shows PING 8.8.8.8 (8.8.8.8): 56 data bytes
# and than hangs indefinetly
sudo apt-get update
在主机上成功运行,即在docker之外的我的计算机上运行。
UPD多克尔版本1.12.1,构建23cf638
apt-get update
在与Docker交互模式下运行吗?