diff --git a/scripts/shared/cleanup.sh b/scripts/shared/cleanup.sh index 490b429ea..6965a1c95 100755 --- a/scripts/shared/cleanup.sh +++ b/scripts/shared/cleanup.sh @@ -20,36 +20,10 @@ function stop_local_registry { fi } -function cleanup_containers { - local containers=$(docker ps -qf status=exited) - if [[ -n ${containers} ]]; then - echo "Cleaning containers..." - docker rm -f ${containers} - fi -} - -function cleanup_images { - local dangling_images=$(docker images -qf dangling=true) - if [[ -n ${dangling_images} ]]; then - echo "Cleaning images..." - docker rmi -f ${dangling_images} - fi -} - -function cleanup_volumes { - local dangling_volumes=$(docker volume ls -qf dangling=true) - if [[ -n ${dangling_volumes} ]]; then - echo "Cleaning volumes..." - docker volume rm -f ${dangling_volumes} - fi -} - ### Main ### run_parallel "{1..3}" delete_cluster stop_local_registry -cleanup_containers -cleanup_images -cleanup_volumes +docker system prune --volumes -f