Skip to content
Back to skills

Ops Docker

ASecurity

Safe Docker cleanup and compose stack management. Prune unused containers/images/volumes, redeploy stacks.

  • 6 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 11, 2026
devopsbashdockerdocumentation

Works with

  • cli

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned September 11, 2026

npx -y skills add grahama1970/agent-skills --skill ops-docker --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ops Docker?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ops Docker
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/grahama1970-ops-docker/badge)](https://www.skillsdirectory.com/skills/grahama1970-ops-docker)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ops-docker
description: >
  Safe Docker cleanup and compose stack management.
  Prune unused containers/images/volumes, redeploy stacks.
triggers:
  - clean up docker
  - prune docker
  - docker cleanup
  - redeploy stack
  - restart containers
  - docker compose redeploy
  - free docker disk space
allowed-tools: Bash
metadata:
  short-description: Safe Docker cleanup and stack management

provides:
  - ops-docker
composes:
  - task-monitor
  - agentic-evals
disciplines:
  - observability-operations
---

# Docker Ops

Safe Docker management with dry-run defaults.

## Commands

```bash
# Prune unused resources (dry-run by default)
./scripts/prune.sh

# Actually prune
./scripts/prune.sh --execute

# Prune images older than 24h
./scripts/prune.sh --until 24h --execute

# Redeploy compose stack (dry-run)
./scripts/redeploy.sh --stack docker-compose.yml

# Actually redeploy
./scripts/redeploy.sh --stack docker-compose.yml --execute

# Redeploy specific service
./scripts/redeploy.sh --stack docker-compose.yml --service web --execute
```

## Environment Variables

| Variable             | Default            | Description                   |
| -------------------- | ------------------ | ----------------------------- |
| `DOCKER_PRUNE_UNTIL` | -                  | Default age filter for prune  |
| `STACK_FILE`         | docker-compose.yml | Default compose file          |
| `HEALTH_CMD`         | -                  | Command to run after redeploy |

## Common Mistakes

### WRONG: Running prune without --execute (or running --execute without checking first)
```bash
./scripts/prune.sh --execute  # prunes without previewing what will be removed
```

### RIGHT: Dry-run first, then execute
```bash
./scripts/prune.sh            # preview (dry-run default)
./scripts/prune.sh --execute  # actually prune after reviewing
```

### WRONG: Redeploying without specifying the stack file
```bash
./scripts/redeploy.sh --execute  # uses default docker-compose.yml, may be wrong stack
```

### RIGHT: Always specify the stack file explicitly
```bash
./scripts/redeploy.sh --stack /path/to/docker-compose.yml --execute
```

### WRONG: Pruning without age filter (removes recently-used images)
```bash
./scripts/prune.sh --execute  # removes all unused, including recent pulls
```

### RIGHT: Use --until to protect recent images
```bash
./scripts/prune.sh --until 24h --execute  # only prune images older than 24h
```

## References (retrieve on demand — do not vendor)

External docs drift; cite the canonical URLs and fetch them when needed
with `/context7` (library docs) or `/fetcher` (any URL/PDF) rather than
caching stale copies. Verified reachable (HTTP 200) 2026-08-24.

- Docker documentation: <https://docs.docker.com/>
- llms.txt (LLM-friendly doc index): <https://docs.docker.com/llms.txt>
- llms-full.txt (expanded LLM index): <https://docs.docker.com/llms-full.txt>

```bash
skills/context7/run.sh "docker compose prune cli"
skills/fetcher/run.sh "https://docs.docker.com/"
```

Files in this skill

  • SKILL.md2.9 KB
  • fixtures/agentic_eval.json3.2 KB
  • run.sh3.4 KB
  • sanity.sh1.1 KB
  • scripts/prune.sh1.6 KB
  • scripts/redeploy.sh2.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.