首页 > 解决方案 > Docker 无法在本地找到图像

问题描述

我是 Docker 新手。几天前我安装了它,并尝试按照Docker Orientation and Setup以及安装 Docker 桌面应用程序时自动打开的快速入门指南进行操作。

方向和设置表明这是我运行代码时应该得到的输出:

$ docker run hello-world

    Unable to find image 'hello-world:latest' locally
    latest: Pulling from library/hello-world
    ca4f61b1923c: Pull complete
    Digest: sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7
    Status: Downloaded newer image for hello-world:latest

    Hello from Docker!
    This message shows that your installation appears to be working correctly.
    ...

我假设如果它无法找到给定的图像,它会自动拉取它并使其可用。但是,这就是我得到的:

$ docker run hello-world
Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp: look
up registry-1.docker.io: no such host.
See 'docker run --help'.

我尝试从 Linux 容器切换到 Windows 容器,但并没有解决问题。我似乎无法在网上找到任何帮助。可能是什么问题呢?

标签: dockerdocker-for-windows

解决方案


你有没有尝试过再次运行相同的图像,它不会给你同样的按摩,所以每当你使用 run 或 pull docker 命令时,docker 会在本地搜索图像,然后它会转到 dockerhub。


推荐阅读