docker问题:Network timed out while trying to connect
2016-03-12 10:36
726 查看
cs202@cs202-devbox:~$ sudo docker run -i -t ubuntu /bin/bash
[sudo] password for cs202:
Unable to find image 'ubuntu:latest' locally
Pulling repository docker.io/library/ubuntu
Network timed out while trying to connect to https://index.docker.io/v1/repositories/library/ubuntu/images. You may want to check your internet connection or if you are behind a proxy.
cs202@cs202-devbox:~$ wget https://index.docker.io/v1/repositories/library/ubuntu/images
--2016-03-11 21:16:29-- https://index.docker.io/v1/repositories/library/ubuntu/images
Resolving index.docker.io (index.docker.io)... 52.0.10.162, 54.152.78.181, 54.164.250.255
Connecting to index.docker.io (index.docker.io)|52.0.10.162|:443... failed: Connection timed out.
Connecting to index.docker.io (index.docker.io)|54.152.78.181|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/json]
Saving to: ‘images’
[ <=> ] 79,813 153KB/s in 0.5s
2016-03-11 21:18:38 (153 KB/s) - ‘images’ saved [79813]
stackoverflow上面有人碰到类似的问题,有人说用下面这种方式可以解决:
I had the same problem this morning and the following fixed it for me:
$ docker-machine restart default # Restart the environment
$ eval $(docker-machine env default) # Refresh your environment se
ttings
It appears that this is due to the Docker virtual machine getting itself into a strange state. There is an open github issue here: https://github.com/docker/docker/issues/20910
这是github上的issue的回复:
Yes, this is a known issue with VirtualBox; after a while (and when switching networks, e.g. when you're connected to a different WiFi network), networking inside VirtualBox stops working correctly. The latest version of Docker Machine should have some improvements,
but restarting the virtual machine sometimes is the only option.
See the discussion on docker/machine#1857.
I'm going to close this issue here, because this is an issue with VirtualBox or Docker Machine / Toolbox, so unfortunately we cannot fix that in this repository. Feel free to comment here after I've closed
但是我什么都没干,只是重试了以下,发现居然也好了:
cs202@cs202-devbox:~$ sudo docker run -i -t ubuntu /bin/bash
Unable to find image 'ubuntu:latest' locally
latest: Pulling from library/ubuntu
073de23ee32b: Pulling fs layer
9d89fd8f8a3e: Pulling fs layer
0b427fcc4cbb: Pulling fs layer
8ed581e3fa7a: Pulling fs layer
Pulling repository docker.io/library/ubuntu
56063ad57855: Pulling dependent layers
454970bd163b: Downloading 8.105 MB
---成功了:
cs202@cs202-devbox:~$ sudo docker run -i -t ubuntu /bin/bash
Unable to find image 'ubuntu:latest' locally
latest: Pulling from library/ubuntu
073de23ee32b: Pulling fs layer
9d89fd8f8a3e: Pulling fs layer
0b427fcc4cbb: Pulling fs layer
8ed581e3fa7a: Pulling fs layer
Pulling repository docker.io/library/ubuntu
56063ad57855: Download complete
454970bd163b: Download complete
38112156678d: Download complete
4e1f7c524148: Download complete
Status: Downloaded newer image for ubuntu:latest
docker.io/library/ubuntu: this image was pulled from a legacy registry. Important: This registry version will not be supported in future versions of docker.
root@257646e19a08:/#
[sudo] password for cs202:
Unable to find image 'ubuntu:latest' locally
Pulling repository docker.io/library/ubuntu
Network timed out while trying to connect to https://index.docker.io/v1/repositories/library/ubuntu/images. You may want to check your internet connection or if you are behind a proxy.
cs202@cs202-devbox:~$ wget https://index.docker.io/v1/repositories/library/ubuntu/images
--2016-03-11 21:16:29-- https://index.docker.io/v1/repositories/library/ubuntu/images
Resolving index.docker.io (index.docker.io)... 52.0.10.162, 54.152.78.181, 54.164.250.255
Connecting to index.docker.io (index.docker.io)|52.0.10.162|:443... failed: Connection timed out.
Connecting to index.docker.io (index.docker.io)|54.152.78.181|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/json]
Saving to: ‘images’
[ <=> ] 79,813 153KB/s in 0.5s
2016-03-11 21:18:38 (153 KB/s) - ‘images’ saved [79813]
stackoverflow上面有人碰到类似的问题,有人说用下面这种方式可以解决:
I had the same problem this morning and the following fixed it for me:
$ docker-machine restart default # Restart the environment
$ eval $(docker-machine env default) # Refresh your environment se
ttings
It appears that this is due to the Docker virtual machine getting itself into a strange state. There is an open github issue here: https://github.com/docker/docker/issues/20910
这是github上的issue的回复:
Yes, this is a known issue with VirtualBox; after a while (and when switching networks, e.g. when you're connected to a different WiFi network), networking inside VirtualBox stops working correctly. The latest version of Docker Machine should have some improvements,
but restarting the virtual machine sometimes is the only option.
See the discussion on docker/machine#1857.
I'm going to close this issue here, because this is an issue with VirtualBox or Docker Machine / Toolbox, so unfortunately we cannot fix that in this repository. Feel free to comment here after I've closed
但是我什么都没干,只是重试了以下,发现居然也好了:
cs202@cs202-devbox:~$ sudo docker run -i -t ubuntu /bin/bash
Unable to find image 'ubuntu:latest' locally
latest: Pulling from library/ubuntu
073de23ee32b: Pulling fs layer
9d89fd8f8a3e: Pulling fs layer
0b427fcc4cbb: Pulling fs layer
8ed581e3fa7a: Pulling fs layer
Pulling repository docker.io/library/ubuntu
56063ad57855: Pulling dependent layers
454970bd163b: Downloading 8.105 MB
---成功了:
cs202@cs202-devbox:~$ sudo docker run -i -t ubuntu /bin/bash
Unable to find image 'ubuntu:latest' locally
latest: Pulling from library/ubuntu
073de23ee32b: Pulling fs layer
9d89fd8f8a3e: Pulling fs layer
0b427fcc4cbb: Pulling fs layer
8ed581e3fa7a: Pulling fs layer
Pulling repository docker.io/library/ubuntu
56063ad57855: Download complete
454970bd163b: Download complete
38112156678d: Download complete
4e1f7c524148: Download complete
Status: Downloaded newer image for ubuntu:latest
docker.io/library/ubuntu: this image was pulled from a legacy registry. Important: This registry version will not be supported in future versions of docker.
root@257646e19a08:/#
相关文章推荐
- docker+node+Cordova 多平台流媒体直播系统 一 centos6.5 源码编译安装node5.8(1)
- docker 学习笔记20:docker守护进程的配置与启动
- 通过docker-machine和etcd部署docker swarm集群
- eclipe che 体验中
- docker学习笔记18:Dockerfile 指令 VOLUME 介绍
- ActiveMQ私有云、公有云以及Docker环境高可用集群方案汇总
- Dockerfile 指令详解
- Docker源码分析(十一):镜像存储
- Docker源码分析(十):Docker镜像下载
- Docker源码分析(九):Docker镜像
- Docker源码分析(八):Docker Container网络(下)
- Docker源码分析(七):Docker Container网络 (上)
- Docker源码分析(六):Docker Daemon网络
- Docker源码分析(五):Docker Server的创建
- Docker源码分析(四):Docker Daemon之NewDaemon实现
- Docker源码分析(三):Docker Daemon启动
- Docker源码分析(二):Docker Client创建与命令执行
- Docker源码分析(一):Docker架构
- docker学习笔记17:Dockerfile 指令 ONBUILD介绍
- docker学习笔记16:Dockerfile 指令 ADD 和 COPY介绍