mirror of
https://github.com/mag37/dockcheck.git
synced 2026-02-28 22:20:35 +01:00
Update dockcheck.sh
This commit is contained in:
parent
b43cd65645
commit
8d5ab4f358
1 changed files with 4 additions and 5 deletions
|
|
@ -28,16 +28,15 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### Check the image-hash of every running container VS the registry
|
### Check the image-hash of every running container VS the registry
|
||||||
for i in $(docker ps --format '{{.Image}},{{.Names}}')
|
for i in $(docker ps --format '{{.Names}}')
|
||||||
do
|
do
|
||||||
RepoUrl=$( echo "$i" | cut -d, -f1)
|
RepoUrl=$(docker inspect $i --format='{{.Config.Image}}')
|
||||||
ContName=$( echo "$i" | cut -d, -f2)
|
|
||||||
LocalHash=$(docker image inspect $RepoUrl --format '{{.RepoDigests}}' | sed -e 's/.*sha256/sha256/' -e 's/\]$//')
|
LocalHash=$(docker image inspect $RepoUrl --format '{{.RepoDigests}}' | sed -e 's/.*sha256/sha256/' -e 's/\]$//')
|
||||||
RegHash=$(./regctl image digest --list $RepoUrl)
|
RegHash=$(./regctl image digest --list $RepoUrl)
|
||||||
if [[ "$LocalHash" != "$RegHash" ]] ; then
|
if [[ "$LocalHash" != "$RegHash" ]] ; then
|
||||||
GotUpdates+=("$ContName")
|
GotUpdates+=("$i")
|
||||||
else
|
else
|
||||||
NoUpdates+=("$ContName")
|
NoUpdates+=("$i")
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue