Bootstrap

docker Error response from daemon: Get “https://registry-1.docker.io/v2/ 的问题处理

docker Error response from daemon: Get "https://registry-1.docker.io/v2/ 的问题处理

最近pull 数据 发现 docker 有如下错误



报错问题

Using default tag: latest
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)

在这里插入图片描述

检查网络连接

这个错误可能是由于网络连接问题导致的,比如无法访问 https://registry-1.docker.io。请确保您的网络连接正常,并且防火墙或代理设置没有阻止 Docker。

如果您在公司网络中并且使用代理,您可能需要配置 Docker 以支持代理设置。可以通过编辑 /etc/systemd/system/docker.service.d/http-proxy.conf 文件来配置。

解决方案,配置镜像源

第一步
在这里插入图片描述

第2步

在这里插入图片描述

{
  "builder": {
    "gc": {
      "defaultKeepStorage": "20GB",
      "enabled": true
    }
  },
  "experimental": false,
  "registry-mirrors": [
    "https://docker.m.daocloud.io",
    "https://docker.1panel.live",
    "https://hub.rat.dev"
  ]
}

您提供的配置是与 Docker 或类似的容器系统相关的设置。以下是这些设置的中文解释:

gc(垃圾回收):

defaultKeepStorage 设置为 20GB,表示在进行垃圾回收时,Docker 会保留最多 20GB 的数据。
enabled 设置为 true,表示启用垃圾回收功能。
experimental 设置为 false,表示禁用了 Docker 的实验性功能。

registry-mirrors 列出了几个自定义的 Docker 镜像源:

https://docker.m.daocloud.io
https://docker.1panel.live
https://hub.rat.dev
这些镜像源可以加速 Docker 镜像的拉取,因为它们可能在某些网络或地区上更接近或经过优化

完成docker pull postgres

在这里插入图片描述

;