我正在尝试在 ubuntu 16.10 上运行一个简单的 rkt 容器。我遇到了一些网络问题。这是我运行的命令。
sudo rkt run --interactive quay.io/coreos/alpine-sh
然后运行:
/ # ping google.com
ping: bad address 'google.com'
/ # ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=58 time=6.815 ms
出来后: sudo rkt list
UUID APP IMAGE NAME STATE CREATED STARTED NETWORKS
4d35bf55 alpine-sh quay.io/coreos/alpine-sh:latest exited 40 seconds ago 39 seconds ago
如您所见,网络选项卡为空。这是我的iptables:
sudo iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere 172.16.28.0/24
ACCEPT all -- 172.16.28.0/24 anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
尝试添加 --dns
sudo rkt run --interactive quay.io/coreos/alpine-sh --dns=8.8.8.8
是谷歌DNS服务器的地址