docs: 修改版本信息以及windows下的镜像拉取问题

This commit is contained in:
Wenjie Zhang 2025-11-15 20:55:04 +08:00
parent 12c7aeb259
commit 7db4071ec8
6 changed files with 68 additions and 7 deletions

View File

@ -4,6 +4,8 @@ SAVE_DIR=./saves
# region model_provider
# 推荐使用硅基流动免费服务
SILICONFLOW_API_KEY=
# 获取搜索服务的 api key 请访问 https://app.tavily.com/
TAVILY_API_KEY=
# # 其余可选配置
# OPENAI_API_KEY=
@ -15,9 +17,6 @@ SILICONFLOW_API_KEY=
# TOGETHER_API_KEY=
# # endregion model_provider
# # 功能服务
# TAVILY_API_KEY=
# # 基础配置示例
# MYSQL_HOST=192.168.1.100
# MYSQL_USER=username

View File

@ -6,7 +6,7 @@ services:
args:
HTTP_PROXY: ${HTTP_PROXY:-}
HTTPS_PROXY: ${HTTPS_PROXY:-}
image: yuxi-api:0.3.dev
image: yuxi-api:0.4.dev
container_name: api-dev
working_dir: /app
volumes:
@ -62,7 +62,7 @@ services:
context: .
dockerfile: docker/web.Dockerfile
target: development
image: yuxi-web:0.3.dev
image: yuxi-web:0.4.dev
container_name: web-dev
volumes:
- ./web/src:/app/src

56
docker/pull_image.ps1 Normal file
View File

@ -0,0 +1,56 @@
param(
[Parameter(Mandatory=$true)]
[string]$ImageTag
)
# 当命令失败时,立即退出脚本
$ErrorActionPreference = "Stop"
Write-Host "Pulling image: $ImageTag" -ForegroundColor Green
# 计算斜杠数量来确定镜像格式
$slashCount = ($ImageTag -split '/' | Measure-Object).Count - 1
# 根据镜像格式设置镜像 URL
switch ($slashCount) {
0 {
# 无前缀 (例如: python:3.12-slim)
$mirrorUrl = "m.daocloud.io/docker.io/library"
Write-Host "Image format: Official image (no prefix)" -ForegroundColor Cyan
}
1 {
# 一个前缀 (例如: milvusdb/milvus:latest)
$mirrorUrl = "m.daocloud.io/docker.io"
Write-Host "Image format: Hub repository (one prefix)" -ForegroundColor Cyan
}
default {
# 两个或更多前缀 (例如: quay.io/coreos/etcd:v3.5.5)
$mirrorUrl = "m.daocloud.io"
Write-Host "Image format: Third-party registry (multiple prefixes)" -ForegroundColor Cyan
}
}
$fullMirrorUrl = "$mirrorUrl/$ImageTag"
Write-Host "Mirror URL: $fullMirrorUrl" -ForegroundColor Yellow
try {
# 从镜像加速器拉取镜像
Write-Host "Step 1: Pulling image from mirror..." -ForegroundColor Blue
docker pull $fullMirrorUrl
# 重新标记为原始名称
Write-Host "Step 2: Tagging image with original name..." -ForegroundColor Blue
docker tag $fullMirrorUrl $ImageTag
# 删除镜像加速器标签
Write-Host "Step 3: Removing mirror tag..." -ForegroundColor Blue
docker rmi $fullMirrorUrl
Write-Host "`nProcess completed successfully!" -ForegroundColor Green
Write-Host "`nCurrent Docker images:" -ForegroundColor Yellow
docker images
} catch {
Write-Host "`nError occurred: $_" -ForegroundColor Red
exit 1
}

View File

@ -5,7 +5,9 @@
## Docker与启动相关问题
### 镜像拉取/构建失败?
镜像拉取:可使用 `docker/pull_image.sh` 辅助拉取
镜像拉取:可使用以下脚本辅助拉取
- **Linux/macOS**: `docker/pull_image.sh`
- **Windows PowerShell**: `docker/pull_image.ps1`
构建失败:若配置了代理仍失败,可尝试以下步骤:
1. 注释 `api.Dockerfile` 中的代理环境变量设置:
```dockerfile

View File

@ -90,7 +90,11 @@ docker logs web-dev -f
如果拉取镜像失败,可以尝试手动拉取:
```bash
# Linux/macOS
bash docker/pull_image.sh python:3.11-slim
# Windows PowerShell
powershell -ExecutionPolicy Bypass -File docker/pull_image.ps1 python:3.11-slim
```
**离线部署方案**

View File

@ -50,4 +50,4 @@ actions:
# 页脚信息
footer:
copyright: "© 江南语析 2025 v0.3.0"
copyright: "© 江南语析 2025 v0.4.0"