From 9c68b2789a85408d4cb489d8669b6b7d4e9dcb14 Mon Sep 17 00:00:00 2001 From: Eliezer Croitoru Date: Sat, 23 Dec 2023 12:28:27 +0000 Subject: [PATCH] 1 --- Makefile | 16 ++++++++++++++++ cleanup-all-images.sh | 12 ++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 Makefile create mode 100644 cleanup-all-images.sh 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