commit 9c68b2789a85408d4cb489d8669b6b7d4e9dcb14 Author: Eliezer Croitoru Date: Sat Dec 23 12:28:27 2023 +0000 1 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2ebf2db --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +all: + echo OK + +cleanup-containers: + printf "y\n" | docker container prune + +cleanup-images: + printf "y\n" | docker image prune + +prune-system: + docker system prune --all + +cleanup-all-images: + sh cleanup-all-images.sh + +cleanup: cleanup-containers cleanup-images diff --git a/cleanup-all-images.sh b/cleanup-all-images.sh new file mode 100644 index 0000000..69a80f3 --- /dev/null +++ b/cleanup-all-images.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env sh + +#IMAGES=$(docker images --filter "dangling=true" -q --no-trunc) + +IMAGES=$(docker images -q --no-trunc) + +if [ -z "${IMAGES}" ] +then + echo "There are no images to cleanup" +else + docker rmi ${IMAGES} +fi