错误:获取 https://registry-1.docker.io/v2/: net/http: Docker 中的 TLS 握手超时

Jef*_*ook 9 docker docker-compose

我浏览了这个链接:Docker push - net/http: TLS handshake timeout,但它没有解决我的问题。我只是使用命令运行https://github.com/sqshq/PiggyMetricsdocker-compose up

Status: Downloaded newer image for sqshq/piggymetrics-mongodb:latest
Pulling rabbitmq (rabbitmq:3-management)...
ERROR: Get https://registry-1.docker.io/v2/: net/http: TLS handshake timeout
[root@ech-10-1XXX PiggyMetrics]#
[root@ech-10-1XXX PiggyMetrics]# docker-compose up
Pulling rabbitmq (rabbitmq:3-management)...
ERROR: Get https://registry-1.docker.io/v2/library/rabbitmq/manifests/3-management: Get https://auth.docker.io/token?scope=repository%3Alibrary%2Frabbitmq%3Apull&service=registry.docker.io: net/http: TLS handshake timeout
Run Code Online (Sandbox Code Playgroud)

部署并运行代码

uname -a

Linux ech-10-XXXX 4.1.12-61.1.18.el7uek.x86_64 #2 SMP Fri Nov 4 15:48:30 PDT 2016 x86_64 x86_64 x86_64 GNU/Linux

Kam*_*san 14

I was facing the same error Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: TLS handshake timeout because of slow internet connection.

Switching to a comparatively faster internet connection didn't fix my problem at first. Then I restarted docker and it worked.

$ sudo systemctl restart docker
Run Code Online (Sandbox Code Playgroud)

  • 在 Windows 10 中,转到窗口左下角的泊坞窗图标。右键单击 docker,倒数第二个选项是重新启动 docker。田田! (2认同)

Dol*_*hin 5

原因是我所在地区的网络政策。您可以更改您的镜像地址并尝试,在我的情况下,我更改了镜像地址并且有效。我使用的是 macOS Catalina:

"registry-mirrors" : [
    "https://dockerhub.azk8s.cn"
  ]
Run Code Online (Sandbox Code Playgroud)

希望这对您有帮助。

在此输入图像描述


小智 5

debug: true放在 docker-engine 选项卡下并重新启动 docker。这对我在MAC M1上有用。在此输入图像描述