Only remove images if we have any.
This commit is contained in:
parent
14646f42b2
commit
fb6ad1030f
6
run.sh
6
run.sh
@ -141,7 +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
|
||||||
docker image rm -f $(docker image ls --quiet --filter 'reference=laconic-webapp')
|
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
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
sleep ${CHECK_INTERVAL:-15}
|
sleep ${CHECK_INTERVAL:-15}
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user