docker run hello-world报错

  • 报错如下:
    在这里插入图片描述
    Unable to find image ‘hello-world:latest’ locally
    docker: Error response from daemon: Get “https://registry-1.docker.io/v2/”: net/http: TLS handshake timeout.

  • 解决方案:

    • 如果运行在虚拟机上,确保能虚拟机下能正常联网,验证方法如下:
      在这里插入图片描述
      能ping通即可,如果不能ping通,解决方法可参考该博客:点这里跳转
  • 如果能正常ping通,进入下一步:配置国内镜像加速器(这里使用的是阿里云的镜像加速器)

https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors
点击上面的链接,进入阿里云镜像加速器页面,根据要求配置镜像源即可。

在这里插入图片描述
执行完上述四个命令后,重新运行docker run hello-world即可正常拉取镜像。


版权声明:本文为msthriving原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。