Docker 在拉取镜像时,依然尝试通过 127.0.0.1:7890 代理连接,但该代理端口无法访问(连接被拒绝)
·
Failed to resolve reference "ghcr.nju.edu.cn/immich-app/immichserver:
release": failed to do request: Head "https://ghcr.nju.edu.cn/v2/immichapp/
immich-server/manifests/release": proxyconnect tcp: dial tcp
127.0.0.1:7890: connect: connection refused
原因1:Docker 配置了无效的代理(可能是之前设置的代理已关闭或端口变更)
1)查看 Docker 代理配置
查看系统级 Docker 配置
cat /etc/docker/daemon.json
# 查看当前用户的 Docker 配置
cat ~/.docker/config.json
2)如果发现包含 127.0.0.1:7890 的代理配置,删除或注释掉这些配置
{
"proxies": {
"default": {
"httpProxy": "http://127.0.0.1:7890", // 删除此行
"httpsProxy": "http://127.0.0.1:7890" // 删除此行
}
}
}
3)重启 Docker 服务使配置生效
# 对于 systemd 系统(Ubuntu/Debian/CentOS)
systemctl daemon-reload
systemctl restart docker
原因2:有时系统级的代理环境变量会影响 Docker
# 查看当前代理环境变量
echo $HTTP_PROXY $HTTPS_PROXY $http_proxy $https_proxy
# 临时取消代理(当前终端有效)
unset HTTP_PROXY HTTPS_PROXY http_proxy https_proxy
更多推荐



所有评论(0)