简体   繁体   English

Docker设置-无法运行世界

[英]Docker set up - cannot run hello-world

This is the first time i am trying to set up docker. 这是我第一次尝试设置docker。 I have followed the instructions, now i can see the docker machine running.. (i am on a mac, yosemite 10.10.5) 我已经按照说明进行操作,现在我可以看到Docker计算机正在运行..(我在Mac上,优胜美地10.10.5)

docker-machine ls
NAME      ACTIVE   URL          STATE     URL                         SWARM   DOCKER   ERRORS
default   *        virtualbox   Running   tcp://192.168.99.100:2376           v1.9.1



docker-machine ip default
192.168.99.100

docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

ran the following to bypass proxy... 运行以下内容绕过代理...

eval $(docker-machine env --no-proxy default)

still the following fails, what could be wrong? 仍然以下失败,可能是什么问题?

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 . 无法在本地找到映像'hello-world:latest'尝试连接到https://index.docker.io/v1/repositories/library/hello-world时,存储库docker.io/library/hello-world网络超时/ images You may want to check your internet connection or if you are behind a proxy. 您可能要检查您的Internet连接或是否在代理后面。

Seems like your docker host cant access the internet, to verify, try docker-machine ssh default 似乎您的Docker主机无法访问互联网以进行验证,请尝试使用docker-machine ssh默认

And run dig Google.com And see if you get some Google ips , if not you will need to check your virtual machine network settings, 并运行dig Google.com,看看是否有一些Google ip,如果没有,您将需要检查虚拟机网络设置,

open virtual box Stop the default vm Go settings--->network Make sure it's set to bridge or nat Start the machine docker-machine start default eval $(docker-machine env default) And try again 打开虚拟框停止默认的vm Go设置--->网络确保将其设置为桥接或nat启动计算机docker-machine start default eval $(docker-machine env default)然后重试

Set your docker proxy: 设置您的Docker代理:

Edit your /etc/default/docker file 编辑您的/etc/default/docker文件

sudo vim /etc/default/docker

Add this entry at bottom: 在底部添加此条目:

export http_proxy="http://PROXY_IP:PROXY_PORT"
export https_proxy="https://PROXY_IP:PROXY_PORT"

Restart the docker service by using the below command: 使用以下命令重新启动docker服务:

sudo service docker restart

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM