mirror of
https://github.com/stefanpejcic/openpanel
synced 2025-06-26 18:28:26 +00:00
Update UPDATE.sh
This commit is contained in:
parent
101b531d70
commit
90de6d47ad
@ -30,7 +30,17 @@ for dir in /home/*; do
|
||||
done
|
||||
|
||||
|
||||
|
||||
echo "Purging old openpanel/openpanel-ui images.."
|
||||
all_images=$(docker --context default images --format "{{.Repository}} {{.ID}}" | grep "^openpanel/openpanel-ui" | awk '{print $2}')
|
||||
used_images=$(docker --context default ps --format "{{.Image}}" | xargs -n1 docker inspect --format '{{.Id}}' 2>/dev/null | sort | uniq)
|
||||
for img in $all_images; do
|
||||
if echo "$used_images" | grep -q "$img"; then
|
||||
echo "⏩ Skipping in-use image: $img"
|
||||
else
|
||||
echo "🗑️ Deleting unused image: $img"
|
||||
docker rmi "$img"
|
||||
fi
|
||||
done
|
||||
|
||||
: '
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user