简体   繁体   English

docker run hello-world - 无法找到图像

[英]docker run hello-world - unable to find image

I installed latest docker version on remote Centos7.2 (version 18.01.0.ce) according the docker install instruction.我根据 docker install 指令在远程 Centos7.2(版本 18.01.0.ce)上安装了最新的 docker 版本。
My docker client and docker server are on the same machine (Virtual machine).我的 docker 客户端和 docker 服务器在同一台机器上(虚拟机)。 when running sudo docker run hello-world I get当运行sudo docker run hello-world我得到

"Unable to find image 'hello-world:latest' locally “无法在本地找到图像 'hello-world:latest'
docker: Error response from daemon: Get https://registry-1.docker.io/v2/ : >net/http: request canceled while waiting for connection (Client.Timeout >exceeded while awaiting headers). docker:来自守护进程的错误响应:获取https://registry-1.docker.io/v2/ :>net/http:请求在等待连接时被取消(Client.Timeout >exceeded while awaiting headers)。 See 'docker run --help'."参见‘docker run --help’。”

Any suggestions on how to solve it?关于如何解决它的任何建议?

The first time you run docker container run hello-world the system will not be able to find the image(container) locally so it should automatically attempt to download the container - it did in my case.第一次运行docker container run hello-world系统将无法在本地找到图像(容器),因此它应该自动尝试下载容器 - 在我的情况下是这样。

Also looks like a connection issue with docker.io you might want to try later or check your internet connection settings.也看起来像 docker.io 的连接问题,您可能想稍后尝试或检查您的互联网连接设置。

Make sure you have internet access on that virtual machine.确保您可以在该虚拟机上访问 Internet。

When you run non-existing docker image, docker engine connects to docker hub and download that image.当您运行不存在的 docker 镜像时,docker 引擎会连接到 docker hub 并下载该镜像。

I have also met this issue when I try to run centos 7 docker from docker hub:当我尝试从 docker hub 运行centos 7 docker 时,我也遇到了这个问题:

docker run -it centos:7

The first message issued was:发出的第一条消息是:

Unable to find image 'centos:7' locally无法在本地找到图像“centos:7”

After a while, I saw the following message:过了一会儿,我看到了以下消息:

7: Pulling from library/centos Digest: sha256:307835c385f656ec2e2fec602cf093224173c51119bbebd602c53c3653a3d6eb Status: Downloaded newer image for centos:7 7:从库/centos 提取摘要:sha256:307835c385f656ec2e2fec602cf093224173c51119bbebd602c53c3653a3d6eb 状态:已下载更新的centos 映像:7

Then I am able to go inside the container.然后我就可以进入容器了。

Setting up proxies and DNS settings were of no use in my case.在我的情况下,设置代理和 DNS 设置没有用。

After extensive research for a couple of days, I was able to overcome the issue using below steps in docker-toolbox bash:经过几天的广泛研究,我能够在 docker-toolbox bash 中使用以下步骤克服这个问题:

  1. Stop the host docker virtual machine:停止主机 docker 虚拟机:

$ docker-machine stop default

  1. Delete the host:删除主机:

$ docker-machine rm default

  1. Create new VirtualBox machine named default :创建名为default 的新 VirtualBox 机器:

$ docker-machine create --driver virtualbox default

  1. Verify if the machine is runnning.验证机器是否正在运行。 ACTIVE attribute should be marked *: $ docker-machine ls ACTIVE属性应标记为 *: $ docker-machine ls

  2. If the machine is not running, run the machine: $ docker-machine run default如果机器没有运行,运行机器: $ docker-machine run default

Then, run hello-world, you will get below screen in your bash然后,运行 hello-world,您将在 bash 中看到以下屏幕

码头工具箱 CLI

Hope it help you guys and save your time!希望它可以帮助你们并节省您的时间!

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

相关问题 sudo docker run hello-world 的 Docker 问题:给出无法找到图像错误:超时 - Docker problem with sudo docker run hello-world: Gives Unable to find image error: Timeout 无法在本地 Docker 中找到图像“hello-world:latest” - Unable to find image 'hello-world:latest' locally Docker 无法在 Windows 10 中为 docker 拉取 hello-world 映像 - Unable to pull hello-world image for docker in Windows 10 无法在本地找到图像“hello-world:latest” - Unable to find image 'hello-world:latest' locally Docker运行hello-world不起作用 - Docker run hello-world not working 无法在本地找到图像“hello-world/hello-world-python:0.0.0.RELEASE” - Unable to find image 'hello-world/hello-world-python:0.0.0.RELEASE' locally docker 中的 Docker:docker 运行 hello-world 错误操作不允许 - Docker in docker : docker run hello-world error operation not permitted Docker:执行'docker run hello-world'命令时出错 - Docker: Error while executing 'docker run hello-world' command 如何使用 AWS Batch 运行“docker run hello-world” - How to run "docker run hello-world" using AWS Batch 使用官方docker映像设置后,Concourse CI将不会运行Hello-World。 无法显示“没有工人” - Concourse CI will not run Hello-World after setting up with the official docker image. It fails showing “no workers”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM