Files
scwrypts/zsh/docker/cleanup
T

30 lines
552 B
Bash
Raw Normal View History

2024-05-10 13:32:02 -06:00
#!/usr/bin/env zsh
2023-02-21 18:44:27 -07:00
DEPENDENCIES+=(docker)
#####################################################################
2024-02-06 14:06:44 -07:00
MAIN() {
2024-05-10 13:32:02 -06:00
local RESOURCES=(
container
image
volume
system
)
2023-02-21 18:44:27 -07:00
2024-05-10 13:32:02 -06:00
echo.warning "
this will prune the following docker resources from the
current machine:
(${RESOURCES[@]})
pruned resources are PERMANENTLY DELETED
"
2026-05-05 15:31:50 -06:00
user.yN 'continue?' || utils.abort
2024-05-10 13:32:02 -06:00
echo.success "$(
for RESOURCE in ${RESOURCES[@]}
do
echo "${RESOURCE}^:^$(docker ${RESOURCE} prune -f 2>/dev/null | tail -n 1)"
done | column -ts '^'
)"
2023-02-21 18:44:27 -07:00
}