diff --git a/DOCKER_CONFIG_FIXED.md b/DOCKER_CONFIG_FIXED.md new file mode 100644 index 0000000..0b1d632 --- /dev/null +++ b/DOCKER_CONFIG_FIXED.md @@ -0,0 +1,94 @@ +# Docker Desktop 镜像加速配置(修正版) + +## ✅ 正确的 JSON 配置 + +复制以下配置到 Docker Desktop → Settings → Docker Engine: + +```json +{ + "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:缺少逗号 + +❌ **错误**: +```json +{ + "experimental": false + "registry-mirrors": [...] +} +``` + +✅ **正确**: +```json +{ + "experimental": false, + "registry-mirrors": [...] +} +``` + +### 错误 2:JSON 格式错误 + +确保: +- 所有键都用双引号包裹 +- 最后一个属性后不要有逗号 +- 数组和对象正确闭合 + +## 配置步骤 + +1. **打开 Docker Desktop** +2. **Settings** → **Docker Engine** +3. **替换整个 JSON 配置**(或添加 `registry-mirrors` 部分) +4. **点击 Apply & Restart** +5. **等待重启完成** + +## 验证配置 + +重启后,在 PowerShell 中运行: + +```powershell +docker info | Select-String -Pattern "Registry Mirrors" -Context 0,3 +``` + +应该能看到配置的镜像源列表。 + +## 如果已有其他配置 + +如果 Docker Engine 中已有其他配置,只需要添加 `registry-mirrors` 部分: + +```json +{ + "existing-config": "...", + "registry-mirrors": [ + "https://docker.mirrors.ustc.edu.cn", + "https://hub-mirror.c.163.com", + "https://mirror.baidubce.com" + ] +} +``` + +## 配置完成后 + +配置完成后,重新构建镜像: + +```powershell +# 构建 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 +``` diff --git a/DOCKER_ENGINE_CONFIG.json b/DOCKER_ENGINE_CONFIG.json new file mode 100644 index 0000000..b06581a --- /dev/null +++ b/DOCKER_ENGINE_CONFIG.json @@ -0,0 +1,14 @@ +{ + "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" + ] +} diff --git a/DOCKER_MIRROR_CONFIG.md b/DOCKER_MIRROR_CONFIG.md index 71e915b..e9778ff 100644 --- a/DOCKER_MIRROR_CONFIG.md +++ b/DOCKER_MIRROR_CONFIG.md @@ -29,6 +29,8 @@ } ``` +**注意**:`"experimental": false` 后面必须有逗号! + 3. 点击 **Apply & Restart** 4. 等待 Docker 重启完成(通常需要 10-30 秒)