mirror of
https://github.com/kossakovsky/n8n-install.git
synced 2026-03-07 14:23:08 +00:00
- move common functions to utils.sh: init_paths, read_env_var, write_env_var, is_profile_active, load_env, gen_password, gen_hex, gen_base64, generate_bcrypt_hash - add documentation headers to all installation scripts - replace duplicate code with shared utility calls - consolidate bcrypt hash generation loop in 03_generate_secrets.sh - add DEBIAN_FRONTEND save/restore helpers for whiptail scripts - standardize path initialization across all scripts
38 lines
1.2 KiB
Bash
Executable File
38 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
# =============================================================================
|
|
# docker_cleanup.sh - Complete Docker system cleanup
|
|
# =============================================================================
|
|
# Aggressively cleans up the Docker system to reclaim disk space.
|
|
# WARNING: This action is irreversible!
|
|
#
|
|
# Removes:
|
|
# - All stopped containers
|
|
# - All networks not used by at least one container
|
|
# - All unused images (not just dangling ones)
|
|
# - All unused volumes
|
|
# - All build cache
|
|
#
|
|
# Usage: make clean OR sudo bash scripts/docker_cleanup.sh
|
|
# =============================================================================
|
|
|
|
set -e
|
|
|
|
# Source the utilities file
|
|
source "$(dirname "$0")/utils.sh"
|
|
|
|
log_info "Starting Docker cleanup..."
|
|
|
|
# The 'docker system prune' command removes:
|
|
# - all stopped containers
|
|
# - all networks not used by at least one container
|
|
# - all "dangling" (unreferenced) images
|
|
# - all build cache
|
|
#
|
|
# Additional flags:
|
|
# -a, --all: Remove all unused images, not just dangling ones.
|
|
# --volumes: Remove all unused volumes.
|
|
# -f, --force: Do not prompt for confirmation.
|
|
|
|
docker system prune -a --volumes -f
|
|
|
|
log_success "Docker cleanup completed successfully." |