docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled

待我称王封你为后i 2023-07-03 08:07 93阅读 0赞

运行docker run hello-world报错

  1. Unable to find image 'hello-world:latest' locally
  2. 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).
  3. See 'docker run --help'.

/etc/docker/daemon.json更换镜像https://registry.docker-cn.comhttp://hub-mirror.c.163.com

  1. {
  2. "registry-mirrors":["http://hub-mirror.c.163.com"]
  3. }

执行docker run hello-world打印日志如下 ,打印成功Hello from Docker!

  1. [root@localhost /]# docker run hello-world
  2. Unable to find image 'hello-world:latest' locally
  3. latest: Pulling from library/hello-world
  4. 1b930d010525: Pull complete
  5. Digest: sha256:9572f7cdcee8591948c2963463447a53466950b3fc15a247fcad1917ca215a2f
  6. Status: Downloaded newer image for hello-world:latest
  7. Hello from Docker!
  8. This message shows that your installation appears to be working correctly.
  9. To generate this message, Docker took the following steps:
  10. 1. The Docker client contacted the Docker daemon.
  11. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
  12. (amd64)
  13. 3. The Docker daemon created a new container from that image which runs the
  14. executable that produces the output you are currently reading.
  15. 4. The Docker daemon streamed that output to the Docker client, which sent it
  16. to your terminal.
  17. To try something more ambitious, you can run an Ubuntu container with:
  18. $ docker run -it ubuntu bash
  19. Share images, automate workflows, and more with a free Docker ID:
  20. https://hub.docker.com/
  21. For more examples and ideas, visit:
  22. https://docs.docker.com/get-started/

发表评论

表情:
评论列表 (有 0 条评论,93人围观)

还没有评论,来说两句吧...

相关阅读