Prune dangling images
This commit is contained in:
parent
fb6ad1030f
commit
359607488c
9
run.sh
9
run.sh
@ -141,10 +141,11 @@ while true; do
|
||||
docker system prune --all --force
|
||||
fi
|
||||
if [[ "${WEBAPP_IMAGE_PRUNE:-true}" == "true" ]]; then
|
||||
OLD_IMAGES="$(docker image ls --quiet --filter 'reference=laconic-webapp')"
|
||||
if [[ -n "$OLD_IMAGES" ]]; then
|
||||
echo "Pruning images: $OLD_IMAGES"
|
||||
docker image rm -f $OLD_IMAGES
|
||||
APP_IMAGES="$(docker image ls --quiet --filter 'reference=laconic-webapp')"
|
||||
DANGLING_IMAGES="$(docker image ls --quiet --filter 'dangling=true')"
|
||||
if [[ -n "$APP_IMAGES" ]] || [[ -n "$DANGLING_IMAGES" ]]; then
|
||||
echo "Pruning images: $APP_IMAGES $DANGLING_IMAGES"
|
||||
docker image rm -f $APP_IMAGES $DANGLING_IMAGES
|
||||
fi
|
||||
fi
|
||||
sleep ${CHECK_INTERVAL:-15}
|
||||
|
Loading…
Reference in New Issue
Block a user