无需安装 Docker,一键检测节点到各上游镜像库的真实连通状态。
$proxy = "https://dk.5667.eu.org"
Write-Host "开始测试节点连通性..." -ForegroundColor Cyan
$targets = @(
@{ Name="Docker Hub"; Path="/v2/library/alpine/manifests/latest" },
@{ Name="ghcr.io"; Path="/v2/ghcr.io/linuxserver/alpine/manifests/latest" },
@{ Name="quay.io"; Path="/v2/quay.io/prometheus/prometheus/manifests/latest" },
@{ Name="registry.k8s.io"; Path="/v2/registry.k8s.io/pause/manifests/3.9" },
@{ Name="mcr.microsoft"; Path="/v2/mcr.microsoft.com/mcr/hello-world/manifests/latest" }
)
foreach ($t in $targets) {
$res = curl.exe -s -o NUL -w "%{http_code}" -H "Accept: application/vnd.docker.distribution.manifest.v2+json" ($proxy + $t.Path)
if ($res -eq "200") { Write-Host "$($t.Name.PadRight(18)) ➜ [可用] HTTP 200" -ForegroundColor Green }
elseif ($res -eq "401") { Write-Host "$($t.Name.PadRight(18)) ➜ [认证] HTTP 401" -ForegroundColor Yellow }
elseif ($res -eq "307") { Write-Host "$($t.Name.PadRight(18)) ➜ [跳转] HTTP 307" -ForegroundColor Green }
else { Write-Host "$($t.Name.PadRight(18)) ➜ [异常] HTTP $res" -ForegroundColor Red }
}
docker pull dk.5667.eu.org/library/nginxdocker pull dk.5667.eu.org/ghcr.io/home-assistant/home-assistant:stabledocker pull dk.5667.eu.org/quay.io/prometheus/prometheus{
"registry-mirrors": ["https://dk.5667.eu.org"]
}systemctl restart docker