Skip to content

biprajit007/docker-cleanup-script-safe-mode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

docker-cleanup-script-safe-mode

A safety-first Bash wrapper around docker system df and docker system prune that defaults to SAFE_MODE=true and asks for confirmation before removal.

Key features

  • Shows current Docker disk usage first
  • Defaults to non-destructive safe mode
  • Interactive confirmation before prune when safe mode is off

Project structure

  • docker_cleanup.sh — Main cleanup script

Requirements

  • Bash
  • Docker CLI and daemon access

Setup

git clone https://github.com/biprajit007/docker-cleanup-script-safe-mode.git
cd docker-cleanup-script-safe-mode
chmod +x docker_cleanup.sh

Usage

Inspect only

./docker_cleanup.sh

Allow pruning

SAFE_MODE=false ./docker_cleanup.sh

Safety notes

  • SAFE_MODE is intentionally true by default.
  • docker system prune -a --volumes can delete stopped containers, unused images, networks, and volumes. Review the prompt carefully.

Limitations / next improvements

  • No per-resource filtering or dry-run diff beyond docker system df
  • Interactive prompt makes unattended automation awkward

About

Safe-mode Bash cleanup tool for unused Docker resources with confirmation safeguards.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages