搜索

PythonReactSEOPDF
OpenClaw

docker-container-cleaner

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

derick0010 来源安装数☆ 0 仓库 Starsv1.0.0

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

SkillHub CLI

skillhub install derick001/docker-container-cleaner

打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。

将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。

查看来源 ↗使用指南

技能说明

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
github
Repository
openclaw/skills
Path
skills/derick001/docker-container-cleaner
Version
1.0.0
Commit
7e58febc31457863d97bdd0b5d01eacfb19c404e
分类来源
rules
状态
active
可见性
public

这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。

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 -...

来源内容

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 -...

相关技能

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