diff --git a/run.sh b/run.sh index b733664..509658b 100755 --- a/run.sh +++ b/run.sh @@ -141,7 +141,11 @@ while true; do docker system prune --all --force fi 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 sleep ${CHECK_INTERVAL:-15} done