Files
wecom-ai-assistant/DOCKER_CONFIG_FIXED.md
bujie9527 edae775129
Some checks failed
Build and Deploy / test-backend (push) Has been cancelled
Build and Deploy / build-backend (push) Has been cancelled
Build and Deploy / build-admin (push) Has been cancelled
Deploy to Production / build-backend (push) Has been cancelled
Deploy to Production / deploy (push) Has been cancelled
Fix Docker Engine JSON configuration syntax
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-05 22:48:32 +08:00

1.8 KiB
Raw Blame History

Docker Desktop 镜像加速配置(修正版)

正确的 JSON 配置

复制以下配置到 Docker Desktop → Settings → Docker Engine

{
  "builder": {
    "gc": {
      "defaultKeepStorage": "20GB",
      "enabled": true
    }
  },
  "experimental": false,
  "registry-mirrors": [
    "https://docker.mirrors.ustc.edu.cn",
    "https://hub-mirror.c.163.com",
    "https://mirror.baidubce.com"
  ]
}

⚠️ 常见错误

错误 1缺少逗号

错误

{
  "experimental": false
  "registry-mirrors": [...]
}

正确

{
  "experimental": false,
  "registry-mirrors": [...]
}

错误 2JSON 格式错误

确保:

  • 所有键都用双引号包裹
  • 最后一个属性后不要有逗号
  • 数组和对象正确闭合

配置步骤

  1. 打开 Docker Desktop
  2. SettingsDocker Engine
  3. 替换整个 JSON 配置(或添加 registry-mirrors 部分)
  4. 点击 Apply & Restart
  5. 等待重启完成

验证配置

重启后,在 PowerShell 中运行:

docker info | Select-String -Pattern "Registry Mirrors" -Context 0,3

应该能看到配置的镜像源列表。

如果已有其他配置

如果 Docker Engine 中已有其他配置,只需要添加 registry-mirrors 部分:

{
  "existing-config": "...",
  "registry-mirrors": [
    "https://docker.mirrors.ustc.edu.cn",
    "https://hub-mirror.c.163.com",
    "https://mirror.baidubce.com"
  ]
}

配置完成后

配置完成后,重新构建镜像:

# 构建 Backend
docker build -f deploy/docker/backend.Dockerfile -t registry.667788.cool/wecom-ai/wecom-ai-backend:latest .

# 推送
docker push registry.667788.cool/wecom-ai/wecom-ai-backend:latest