# 测试 Docker 镜像 # 用途:快速测试镜像是否可以正常运行 param( [string]$Tag = "latest", [string]$Registry = "registry.667788.cool" ) Write-Host "=== 测试 Docker 镜像 ===" -ForegroundColor Cyan Write-Host "" # 测试 Backend 镜像 Write-Host "1. 测试 Backend 镜像..." -ForegroundColor Yellow $backendImage = "$Registry/wecom-backend:$Tag" docker run --rm $backendImage python --version if ($LASTEXITCODE -eq 0) { Write-Host "✓ Backend 镜像正常" -ForegroundColor Green } else { Write-Host "✗ Backend 镜像测试失败" -ForegroundColor Red } Write-Host "" # 测试 Admin 镜像 Write-Host "2. 测试 Admin 镜像..." -ForegroundColor Yellow $adminImage = "$Registry/wecom-admin:$Tag" docker run --rm $adminImage node --version if ($LASTEXITCODE -eq 0) { Write-Host "✓ Admin 镜像正常" -ForegroundColor Green } else { Write-Host "✗ Admin 镜像测试失败" -ForegroundColor Red } Write-Host "" # 测试 Nginx 镜像 Write-Host "3. 测试 Nginx 镜像..." -ForegroundColor Yellow $nginxImage = "$Registry/wecom-nginx:$Tag" docker run --rm $nginxImage nginx -v if ($LASTEXITCODE -eq 0) { Write-Host "✓ Nginx 镜像正常" -ForegroundColor Green } else { Write-Host "✗ Nginx 镜像测试失败" -ForegroundColor Red } Write-Host "" Write-Host "=== 测试完成 ===" -ForegroundColor Cyan Write-Host ""