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
|
docker system prune --all --force
|
||||||
fi
|
fi
|
||||||
if [[ "${WEBAPP_IMAGE_PRUNE:-true}" == "true" ]]; then
|
if [[ "${WEBAPP_IMAGE_PRUNE:-true}" == "true" ]]; then
|
||||||
OLD_IMAGES="$(docker image ls --quiet --filter 'reference=laconic-webapp')"
|
APP_IMAGES="$(docker image ls --quiet --filter 'reference=laconic-webapp')"
|
||||||
if [[ -n "$OLD_IMAGES" ]]; then
|
DANGLING_IMAGES="$(docker image ls --quiet --filter 'dangling=true')"
|
||||||
echo "Pruning images: $OLD_IMAGES"
|
if [[ -n "$APP_IMAGES" ]] || [[ -n "$DANGLING_IMAGES" ]]; then
|
||||||
docker image rm -f $OLD_IMAGES
|
echo "Pruning images: $APP_IMAGES $DANGLING_IMAGES"
|
||||||
|
docker image rm -f $APP_IMAGES $DANGLING_IMAGES
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
sleep ${CHECK_INTERVAL:-15}
|
sleep ${CHECK_INTERVAL:-15}
|
||||||
|
Loading…
Reference in New Issue
Block a user