Fix Docker Engine JSON configuration syntax
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

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
bujie9527
2026-02-05 22:48:32 +08:00
parent 3c95ae0000
commit edae775129
3 changed files with 110 additions and 0 deletions

94
DOCKER_CONFIG_FIXED.md Normal file
View File

@@ -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": [...]
}
```
### 错误 2JSON 格式错误
确保:
- 所有键都用双引号包裹
- 最后一个属性后不要有逗号
- 数组和对象正确闭合
## 配置步骤
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
```

14
DOCKER_ENGINE_CONFIG.json Normal file
View File

@@ -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"
]
}

View File

@@ -29,6 +29,8 @@
} }
``` ```
**注意**`"experimental": false` 后面必须有逗号!
3. 点击 **Apply & Restart** 3. 点击 **Apply & Restart**
4. 等待 Docker 重启完成(通常需要 10-30 秒) 4. 等待 Docker 重启完成(通常需要 10-30 秒)