Files
scwrypts/zsh/docker/cleanup
T

20 lines
622 B
Bash
Raw Normal View History

2023-02-21 18:44:27 -07:00
#!/bin/zsh
DEPENDENCIES+=(docker)
REQUIRED_ENV+=()
CHECK_ENVIRONMENT
#####################################################################
DOCKER_CLEAN() {
WARNING 'this will prune all docker resources from the current machine'
WARNING 'pruned resources are PERMANENTLY DELETED'
yN 'continue?' || return 1
SUCCESS "CONTAINER : $(docker container prune -f 2>/dev/null | tail -n 1)"
SUCCESS "IMAGE : $(docker image prune -f 2>/dev/null | tail -n 1)"
SUCCESS "VOLUME : $(docker volume prune -f 2>/dev/null | tail -n 1)"
}
#####################################################################
DOCKER_CLEAN $@