我在基于 KVM 运行的 CoreOS VM 上安装了 Docker。
虚拟机网络:
$ virsh net-edit libvirt
<network ipv6='yes'>
<name>libvirt</name>
<uuid></uuid>
<forward mode='nat'/>
<bridge name='virbr1' stp='on' delay='0'/>
<mac address=''/>
<domain name='testbed.net' localOnly='yes'/>
<dns>
<host ip='192.168.121.104'>
<hostname>m00.testbed.net</hostname>
</host>
</dns>
<ip address='192.168.121.1' netmask='255.255.255.0'>
<dhcp>
<range start='192.168.121.100' end='192.168.121.254'/>
<host mac='' name='m00.net' ip='192.168.121.104'/>
<bootp file='/pxelinux.0' server='192.168.121.2'/>
</dhcp>
</ip>
</network>
docker.conf:
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network.target docker.socket
Requires=docker.socket
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock --dns x.x.x.x
Environment="https_proxy=http://x.x.x.x:9080" "http_proxy=http://x.x.x.x:9080" "no_proxy=localhost,127.0.0.1"
LimitNOFILE=1048576
LimitNPROC=1048576
TasksMax=1048576
[Install]
Also=docker.socket
一旦我在虚拟机上运行 docker 容器,我就无法再在主机上访问互联网了。
$ sudo apt update
0% [Connecting to proxy (x.x.x.x)] [Connecting to proxy(x.x.x.x)]
有什么建议吗?
谢谢