小c的时光归档 By design, the Internet core is stupid, and the edge is smart.
歌曲封面 未知作品

本站支持SSL安全访问

本站支持SSL安全访问

Written by Human, Not by AI

粤ICP备2023130441号

粤公网安备44040402000217号

Powered by Typecho & Sunny

2 online · 558 ms

Title

【2024可用】解决Docker拉取镜像时的TLS报错

Emotion

·

Article

起因

在pull镜像的时候遇到报错,如下:
docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: TLS handshake timeout
Get https://registry-1.docker.io/v2/: net/http: request canceled
......

原因

docker的默认为国外官方源,下载速度较慢,可改为国内镜像站

解决方法

  1. 服务器终端
    vim /etc/docker/daemon.json
  2. 输入“i”进入编辑模式:

    ♾️ text 代码:
    {
     "registry-mirrors": [
         "https://dockerproxy.com",
         "https://docker.m.daocloud.io",
         "https://docker.nju.edu.cn"
     ]
    }
  3. “Esc”进入命令模式,输入“:wq”保存并退出。
  4. 重启docker服务后继续原来的pull命令
    systemctl restart docker
现在已有 0 条评论,1 人点赞
Comment
发表
搜 索 消 息 足 迹
你还不曾留言过..
你还不曾留下足迹..
博主