diff --git a/src/myci-docker-clean.sh b/src/myci-docker-clean.sh new file mode 100755 index 0000000..8e6f41a --- /dev/null +++ b/src/myci-docker-clean.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# we want exit immediately if any command fails and we want error in piped commands to be preserved +set -eo pipefail + +echo "remove stopped containers" +docker container prune --force +echo "" + +echo "remove unused volumes" +docker volume prune --all --force +echo "" + +echo "remove dangling images" +docker image prune --force