Search

PythonReactSEOPDF
OpenClaw

docker-container-cleaner

CLI tool to clean up stopped Docker containers, unused images, volumes, and networks to free up disk space.

derick0010 source installs☆ 0 Repository starsv1.0.0

Installation

Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.

SkillHub CLI

skillhub install derick001/docker-container-cleaner

Inspect the source and compatibility requirements, then follow its installation steps.

Give your agent the source link and ask it to inspect instructions and dependencies before explaining the installation steps.

View source ↗Guides

Skill instructions

Docker Container Cleaner

What This Does

A CLI tool that helps clean up Docker resources to free up disk space. It can:

  • List and remove stopped containers
  • Remove dangling images (images with no tag)
  • Remove unused images (not used by any container)
  • Remove unused volumes
  • Remove unused networks
  • Perform a "prune all" operation (Docker system prune)

The tool provides a safe, interactive mode by default, showing what will be removed and asking for confirmation before deleting anything.

When To Use

  • Your Docker disk usage is growing and you need to free up space
  • You have many stopped containers that are no longer needed
  • You have old, unused images taking up disk space
  • You want to clean up Docker resources in a controlled, safe way
  • You need to automate Docker cleanup in scripts or CI/CD pipelines

Usage

Interactive cleanup (recommended for first use):

python3 scripts/main.py clean

Remove stopped containers only:

python3 scripts/main.py clean --containers

Remove dangling images only:

python3 scripts/main.py clean --images --dangling

Remove unused images (all images not used by containers):

python3 scripts/main.py clean --images --unused

Remove unused volumes:

python3 scripts/main.py clean --volumes

Remove unused networks:

python3 scripts/main.py clean --networks

Force cleanup (no confirmation):

python3 scripts/main.py clean --all --force

Dry run (show what would be removed):

python3 scripts/main.py clean --all --dry-run

Examples

Example 1: Interactive cleanup
python3 scripts/main.py clean

Output:

Docker Cleanup Tool
===================

Found resources:
- Stopped containers: 3 (using 1.2GB)
- Dangling images: 5 (using 850MB)
- Unused images: 2 (using 450MB)
- Unused volumes: 1 (using 100MB)
- Unused networks: 0

Total disk space that can be freed: 2.6GB

What would you like to clean up?
1. Remove stopped contai...

Source information

Source
github
Repository
openclaw/skills
Path
skills/derick001/docker-container-cleaner
Version
1.0.0
Commit
7e58febc31457863d97bdd0b5d01eacfb19c404e
Classification source
rules
Status
active
Visibility
public

These signals come from indexed source analysis and may lag behind changes. Check the current source files.

README

Docker Container Cleaner

A command-line tool to clean up Docker resources (containers, images, volumes, networks) to free up disk space.

Installation

This skill requires:

  • Python 3.x
  • Docker: Must be installed and the Docker daemon must be running
  • Docker CLI: Must be available in PATH (docker command)

Optional but recommended:

pip install docker

The Docker SDK for Python provides better performance and more reliable operations than shelling out to the docker CLI.

Quick Start

# Interactive cleanup (recommended for first use)
python3 scripts/main.py clean

# Show current Docker resource usage
python3 scripts/main.py status

# Remove stopped containers only
python3 scripts/main.py clean --containers

# Remove dangling images only
python3 scripts/main.py clean --images --dangling

# Force cleanup of everything (no confirmation)
python3 scripts/main.py clean --all --force

# Dry run (show what would be removed)
python3 scripts/main.py clean --all --dry-run

Command Reference

status command

Show current Docker resource usage.

python3 scripts/main.py status [OPTIONS]

Options:

  • --format: Output format: table (human-readable) or json. Default: table
  • --verbose: Show detailed information
clean command

Clean up Docker resources.

python3 scripts/main.py clean [OPTIONS]

Options:

  • --containers: Remove stopped containers
  • --images: Remove images (requires --dangling or --unused)
  • --dangling: Remove dangling images (images with no tag)
  • --unused: Remove unused images (not used by any container)
  • --volumes: Remove unused volumes
  • --networks: Remove unused networks
  • --all: Clean all resource types (equivalent to --containers --images --volumes --networks)
  • --force: Skip confirmation prompts
  • --dry-run: Show what would be removed without actually removing
  • --yes: Auto-answer "yes" to all prompts
  • --no-interactive: Disable interactive mode (use with -...

Extracted content

SKILL.md
# Docker Container Cleaner

## What This Does

A CLI tool that helps clean up Docker resources to free up disk space. It can:
- List and remove stopped containers
- Remove dangling images (images with no tag)
- Remove unused images (not used by any container)
- Remove unused volumes
- Remove unused networks
- Perform a "prune all" operation (Docker system prune)

The tool provides a safe, interactive mode by default, showing what will be removed and asking for confirmation before deleting anything.

## When To Use

- Your Docker disk usage is growing and you need to free up space
- You have many stopped containers that are no longer needed
- You have old, unused images taking up disk space
- You want to clean up Docker resources in a controlled, safe way
- You need to automate Docker cleanup in scripts or CI/CD pipelines

## Usage

Interactive cleanup (recommended for first use):
```bash
python3 scripts/main.py clean
```

Remove stopped containers only:
```bash
python3 scripts/main.py clean --containers
```

Remove dangling images only:
```bash
python3 scripts/main.py clean --images --dangling
```

Remove unused images (all images not used by containers):
```bash
python3 scripts/main.py clean --images --unused
```

Remove unused volumes:
```bash
python3 scripts/main.py clean --volumes
```

Remove unused networks:
```bash
python3 scripts/main.py clean --networks
```

Force cleanup (no confirmation):
```bash
python3 scripts/main.py clean --all --force
```

Dry run (show what would be removed):
```bash
python3 scripts/main.py clean --all --dry-run
```

## Examples

### Example 1: Interactive cleanup

```bash
python3 scripts/main.py clean
```

Output:
```
Docker Cleanup Tool
===================

Found resources:
- Stopped containers: 3 (using 1.2GB)
- Dangling images: 5 (using 850MB)
- Unused images: 2 (using 450MB)
- Unused volumes: 1 (using 100MB)
- Unused networks: 0

Total disk space that can be freed: 2.6GB

What would you like to clean up?
1. Remove stopped contai...
README
# Docker Container Cleaner

A command-line tool to clean up Docker resources (containers, images, volumes, networks) to free up disk space.

## Installation

This skill requires:
- Python 3.x
- **Docker**: Must be installed and the Docker daemon must be running
- **Docker CLI**: Must be available in PATH (`docker` command)

Optional but recommended:
```bash
pip install docker
```

The Docker SDK for Python provides better performance and more reliable operations than shelling out to the `docker` CLI.

## Quick Start

```bash
# Interactive cleanup (recommended for first use)
python3 scripts/main.py clean

# Show current Docker resource usage
python3 scripts/main.py status

# Remove stopped containers only
python3 scripts/main.py clean --containers

# Remove dangling images only
python3 scripts/main.py clean --images --dangling

# Force cleanup of everything (no confirmation)
python3 scripts/main.py clean --all --force

# Dry run (show what would be removed)
python3 scripts/main.py clean --all --dry-run
```

## Command Reference

### `status` command
Show current Docker resource usage.

```
python3 scripts/main.py status [OPTIONS]
```

Options:
- `--format`: Output format: `table` (human-readable) or `json`. Default: `table`
- `--verbose`: Show detailed information

### `clean` command
Clean up Docker resources.

```
python3 scripts/main.py clean [OPTIONS]
```

Options:
- `--containers`: Remove stopped containers
- `--images`: Remove images (requires --dangling or --unused)
- `--dangling`: Remove dangling images (images with no tag)
- `--unused`: Remove unused images (not used by any container)
- `--volumes`: Remove unused volumes
- `--networks`: Remove unused networks
- `--all`: Clean all resource types (equivalent to --containers --images --volumes --networks)
- `--force`: Skip confirmation prompts
- `--dry-run`: Show what would be removed without actually removing
- `--yes`: Auto-answer "yes" to all prompts
- `--no-interactive`: Disable interactive mode (use with -...

Related skills

OpenClaw

agent-pack-n-go

aicodelion

🚀 Clone your OpenClaw AI Agent to a new device in ~25 minutes — configs, memory, skills, everything.

OpenClaw

cacheforge-skills

cacheforge-ai

⚡ SOTA agent skills for OpenClaw — observability, security, code quality, incident response, and more. Built by Anvil AI.

OpenClaw

restart-guard

zjianru

OpenClaw Skill: Safely restart the Gateway with context preservation, guardian watchdog, and multi-channel notification