终端命令添加 Docker 镜像加速
拉取镜像出现以下问题(域名被墙或者网络问题)
err: 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)
如果是域名被墙的话更换镜像加速源
以部分镜像加速举例
以下是一整条命令,一起复制到终端运行
# 将内容写入 /etc/docker/daemon.json 文件,使用 nano 或者 vim
# 配置 Docker 镜像,使用多个镜像源来提高镜像下载速度
nano /etc/docker/daemon.json
# 修改registry-mirrors为以下内容
"registry-mirrors": [
"https://proxy.1panel.live",
"https://dockerproxy.cn",
"https://hub1.nat.tf"
]
# 重启 Docker 服务以使配置生效
sudo systemctl restart docker
评论区