Files
MemRelay/projects/6f47523e-e22e-4cdd-bd18-76e5e474ee0c/Docker Hub 连接失败排障.md
T

42 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: Docker Hub 连接失败排障
type: experience
permalink: main/projects/6f47523e-e22e-4cdd-bd18-76e5e474ee0c/docker-hub-连接失败排障
stable_id: 61e30ee3-0e26-4d64-b00e-f77bc3a3fd60
scope: project
project_id: 6f47523e-e22e-4cdd-bd18-76e5e474ee0c
memory_type: experience
status: active
revision: 1
restored_from_commit: 6a6a895eafcca6052e81a14fca103a42635dd1c2
created_at: '2026-09-23T14:58:36.607100+00:00'
updated_at: '2026-09-23T14:58:36.607150+00:00'
tags:
- docker
- proxy
- troubleshooting
---
## 问题
docker build 拉取 ubuntu:24.04 时报错:failed to fetch oauth token,dial tcp auth.docker.io:443 超时或连接重置。
## 原因
- Docker Desktop 代理模式为 System,手动配置的代理地址不生效。
- OPENWRT_BUILD_PROXY 只传给 docker run,不影响 docker build 拉取基础镜像。
- registry-mirrors 配置的第三方加速地址不可用时也会导致失败。
## 解决方案
1. Docker Desktop → Settings → Resources → Proxies → 选择 Manual proxy configuration
2. HTTP 和 HTTPS Proxy 都填 http://127.0.0.1:7897
3. Apply & Restart
4. 先验证 docker pull ubuntu:24.04 成功
5. 然后重新构建
## 注意事项
- settings-store.json 中 ProxyHTTPMode 必须为 manual 才能使用 OverrideProxyHTTP
- 如果保持 System 模式,必须在代理软件中开启“设置为系统代理”
- 容器内下载需另外设置 OPENWRT_BUILD_PROXY(回环地址会被转换为 host.docker.internal)