Files
.dotfile/script/docker-clean.sh
T
laily 67291a9a50 feat: add script catalog and -h help for all dotfile scripts
Introduce ff script -h with auto descriptions, shared help.sh, and usage flags across script/*.sh.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 15:09:35 +08:00

26 lines
566 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# 清理 Docker 未使用的镜像、容器与缓存(docker system prune -a)
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck disable=SC1091
source "$SCRIPT_DIR/common/help.sh"
usage() {
cat <<'EOF'
用法: docker-clean
执行 docker system prune -a,删除未使用的镜像、容器、网络等。
选项:
-h, --help 显示此帮助
警告: 会删除未使用的镜像,请确认无重要 dangling 资源。
EOF
}
dotfile_help_requested "${1:-}" && dotfile_show_help
set -euo pipefail
docker system prune -a