This commit is contained in:
2025-11-01 16:42:15 +08:00
parent da355d8bd3
commit 3c5df92c06
2 changed files with 70 additions and 8 deletions

43
check-images.sh Executable file
View File

@@ -0,0 +1,43 @@
#!/bin/bash
echo "=== 镜像检测测试 ==="
echo
# 检查 digital-archive 镜像
echo "🔍 检查可用的 digital-archive 镜像:"
docker images "digital-archive*" --format "table {{.Repository}}\t{{.Tag}}\t{{.Size}}\t{{.CreatedAt}}" || echo "❌ 未找到任何 digital-archive 镜像"
echo
echo "🧪 测试镜像检测逻辑:"
# 测试 stable 镜像
stable_image=$(docker images "digital-archive:stable" --format "{{.Repository}}:{{.Tag}}" | head -1)
if [ -n "$stable_image" ]; then
echo "✅ 找到 stable 镜像: $stable_image"
else
echo "❌ 未找到 stable 镜像"
fi
# 测试 fast 镜像
fast_image=$(docker images "digital-archive:fast" --format "{{.Repository}}:{{.Tag}}" | head -1)
if [ -n "$fast_image" ]; then
echo "✅ 找到 fast 镜像: $fast_image"
else
echo "❌ 未找到 fast 镜像"
fi
echo
echo "📋 推荐操作:"
if [ -n "$stable_image" ]; then
echo " ./archive-manager.sh deploy # 使用 stable 版本"
fi
if [ -n "$fast_image" ]; then
echo " ./archive-manager.sh deploy -f # 使用 fast 版本"
fi
if [ -z "$stable_image" ] && [ -z "$fast_image" ]; then
echo " ./archive-manager.sh build # 构建镜像"
echo " ./archive-manager.sh build -f # 快速构建"
fi
echo
echo "=== 测试完成 ==="