Files
ljwx-health/check-registry.sh
2025-12-17 11:18:26 +01:00

46 lines
1.3 KiB
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
echo "========================================="
echo "📦 本地 Registry 镜像检查"
echo "========================================="
echo ""
echo "🔍 Registry 容器状态:"
docker ps | grep -E "NAME|registry" | grep -v grep
echo ""
echo "📋 Registry 中的所有仓库:"
curl -s -u admin:admin123 http://localhost:5000/v2/_catalog | jq '.'
echo ""
echo "🏷️ ljwx-health 项目的镜像:"
REPOS=$(curl -s -u admin:admin123 http://localhost:5000/v2/_catalog | jq -r '.repositories[]' 2>/dev/null)
if [ -z "$REPOS" ]; then
echo "暂无镜像(CI/CD 构建中...)"
else
for repo in $REPOS; do
if [[ $repo == ljwx-health/* ]]; then
echo ""
echo "📦 $repo:"
TAGS=$(curl -s -u admin:admin123 "http://localhost:5000/v2/$repo/tags/list" | jq -r '.tags[]?' 2>/dev/null)
if [ -z "$TAGS" ]; then
echo " └─ 暂无标签"
else
for tag in $TAGS; do
echo " └─ $tag"
done
fi
fi
done
fi
echo ""
echo "========================================="
echo "💡 实用命令"
echo "========================================="
echo "访问 Web UI: http://localhost:8888"
echo "重新运行检查: ./check-registry.sh"
echo "查看 K3s 部署: ./monitor-deployment.sh"
echo ""