dcr
is a command-line tool designed to help clean up unused Docker resources, including images, containers, and volumes. It provides an interactive, user-friendly way to free up disk space and manage Docker resources efficiently.
- List all Docker images, containers, and volumes
- Remove unused Docker images
- Remove stopped Docker containers
- Remove dangling Docker volumes
- Dry-run mode to preview deletions before execution
- Interactive confirmation for safe cleanup
Ensure you have Docker installed on your system. You can download and install Docker from Docker's official website.
Make sure you have Rust installed. If not, install it using Rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Then, clone the repository and build the project:
git clone https://github.com/yourusername/dcr.git
cd dcr
cargo build --release
For system-wide installation, run:
cargo install --path .
Run dcr
with the available options:
dcr --help
- List all Docker resources (images, containers, volumes):
dcr --list-all
- List Docker images:
dcr --list-images
- List Docker containers:
dcr --list-containers
- List Docker volumes:
dcr --list-volumes
- Remove unused images:
dcr --images
- Remove stopped containers:
dcr --containers
- Remove unused volumes:
dcr --volumes
- Preview what would be deleted (Dry-run mode):
dcr --images --dry-run
If you want to contribute or modify dcr
, install dependencies and run:
cargo check
cargo fmt
cargo clippy
cargo test
This project is licensed under the MIT License. See the LICENSE
file for details.
Daniel Morlim
Feel free to contribute by submitting issues or pull requests!