我刚刚在他们的网页上安装了Docker-Toolbox
我从Docker快速入门终端开始,如下所示
## .
## ## ## ==
## ## ## ## ## ===
/"""""""""""""""""\___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~
\______ o __/
\ \ __/
\____\_______/
docker is configured to use the default machine with IP 192.168.99.100
For help getting started, check out the docs at https://docs.docker.com
bash-3.2$
但当我尝试执行docker拉hello-world时,这是我看到的
bash-3.2$ docker run hello-world
Unable to find image 'hello-world:latest' locally
Pulling repository docker.io/library/hello-world
Network timed out while trying to connect to https://index.docker.io/v1/repositories/library/hello-world/images. You may want to check your internet connection or if you are behind a proxy.
bash-3.2$
怎么了?
我昨天遇到了这个完全相同的问题,没有一个“流行”的答案(比如将DNS修复到8.8.8.8)对我有效。我最终偶然发现了这个链接,这就成功了……https://github.com/docker/for-win/issues/16
在Docker for Windows, Windows 10和Hyper-V之间,在虚拟网络适配器创建过程中似乎有一个问题。具体来说,您可能最终会得到两个“vEthernet (DockerNAT)”网络适配器。使用Get-NetAdapter“vEthernet (DockerNAT)”检查(在一个升高的PowerShell控制台)。如果结果显示了多个适配器,您可以禁用并重命名它:
$vmNetAdapter = Get-VMNetworkAdapter -ManagementOS -SwitchName DockerNAT
Get-NetAdapter "vEthernet (DockerNAT)" | ? { $_.DeviceID -ne $vmNetAdapter.DeviceID } | Disable-NetAdapter -Confirm:$False -PassThru | Rename-NetAdapter -NewName "OLD"
然后打开Device Manager并删除禁用的适配器(出于某种原因,可以从这里执行,但不能从Network and Sharing Center适配器视图执行)。
在Windows 7上,如果你认为你落后于代理
Logon to default machine
$ docker-machine ssh default
Update profile to update proxy settings
docker@default:~$ sudo vi /var/lib/boot2docker/profile
Append from the below as appropriate
# replace with your office's proxy environment
export"HTTP_PROXY=http://PROXY:PORT"
export"HTTPS_PROXY=http://PROXY:PORT"
# you can add more no_proxy with your environment.
export"NO_PROXY=192.168.99.*,*.local,169.254/16,*.example.com,192.168.59.*"
Exit
docker@default:~$ exit
Restart docker machine
docker-machine restart default
Update environment settings
eval $(docker-machine env default)
以上步骤略有调整,但请参见故障排除指南:https://docs.docker.com/toolbox/faqs/troubleshoot/#/update-varlibboot2dockerprofile-on-the-docker-machine