mirror of
https://github.com/DaoCloud/public-image-mirror.git
synced 2025-08-07 14:39:01 +08:00
Add check image exists
This commit is contained in:
15
hack/verify-image.sh
Executable file
15
hack/verify-image.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
patch_url=$1
|
||||
|
||||
file=mirror.txt
|
||||
|
||||
cp "${file}" "${file}.bak"
|
||||
|
||||
git apply -R <(curl -fsSL "${patch_url}")
|
||||
|
||||
list=$(diff --unified "${file}" "${file}.bak" | grep -e '^+\w' | sed 's/^+//')
|
||||
|
||||
for image in ${list}; do
|
||||
skopeo inspect --raw "docker://${image}" || { echo "Not Found ${image}" ; exit 1; }
|
||||
done
|
Reference in New Issue
Block a user