Token导航 LogoToken导航TokenDH.com
运维敏感数据clawhub未标认证来源可访问clear审计提醒

docker-opsDocker OPS 搜索

Agent Skill

用于辅助云资源、部署、容器、基础设施和运维自动化任务。它适合让 Agent 检查配置、整理部署步骤、分析资源状态、生成排障思路或辅助云服务接入。使用时需要明确目标环境、账号权限、区域和资源组,区分本地测试与生产操作;涉及删除资源、重启服务、修改网络或权限配置时,应先确认影响范围。

总安装

4,944

周安装

173

GitHub Stars

公开资料未说明

下载量

1,552
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:docker-ops(Docker OPS 搜索)
来源仓库:https://github.com/elston/docker-ops
安装命令:
openclaw skills install docker-ops
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install docker-ops

简介

通过 docker-socket-proxy 安全地管理 Docker 容器:检查状态、日志、资源使用情况,并仅安全地重新启动具有冷却时间的白名单容器。

SKILL.md

docker-ops

Manage Docker containers: status reports, log analysis, and restarts via docker-socket-proxy.

Prerequisites

  • docker CLI available in PATH
  • jq available in PATH
  • DOCKER_HOST environment variable is pre-configured (do NOT override it manually)
  • whitelist.yml in the agent workspace root

Whitelist

Before any Docker command, check the SYSCTL_WHITELIST_PATH environment variable.

If SYSCTL_WHITELIST_PATH is NOT set or empty:

  • Do NOT run any Docker commands
  • Reply: "⚠️ SYSCTL_WHITELIST_PATH is not configured. Set this environment variable in the container to point to the whitelist YAML file."
  • This applies to ALL requests without exception

If set, read the whitelist file from that path. There is no fallback file.

Structure:

containers:
  - name: container_name
    description: "Human description"
    can_restart: true|false

Rules:

  • NEVER run Docker commands against containers not in the whitelist
  • NEVER restart containers where can_restart: false
  • If a requested container is not in the whitelist, respond: "Container <name> is not in the whitelist. Available: <list>"

Allowed Commands

You may ONLY use these Docker commands:

CommandWhen
docker ps --format jsonList running containers
docker ps -a --format jsonList all containers (including stopped)
docker inspect <name>Get container details (status, uptime, restart count)
docker stats --no-stream --format json <name>Get resource usage (CPU, RAM, NET, BLOCK)
docker logs --since <period> --tail 500 <name>Read container logs
docker restart <name>Restart a container (explicit request only!)

Forbidden Commands

NEVER execute: docker rm, docker stop, docker kill, docker exec, docker run, docker pull, docker build, docker push, docker network, docker volume, docker image, docker system, docker compose.

Report Procedure

When asked for a status report:

Step 1: Parse the period

Convert user text to --since parameter:

  • "за последний час" / "last hour" → 1h
  • "за сегодня" / "today" → 24h
  • "за 30 минут" / "30 minutes" → 30m
  • "за неделю" / "last week" → 168h
  • No period specified → default 1h
  • Maximum: 168h (7 days). If user requests more — cap at 168h and inform them.

Step 2: Collect data

All docker commands must be wrapped with timeout 30 to prevent hanging.

# Status + uptime + restart count
timeout 30 docker inspect <name> | jq '.[0] | {Status: .State.Status, StartedAt: .State.StartedAt, RestartCount: .RestartCount, Health: .State.Health.Status}'

# Resource usage
timeout 30 docker stats --no-stream --format '{{json .}}' <name>

# Fetch logs once, then count errors and warnings locally
LOG_OUTPUT=$(timeout 30 docker logs --since <period> --tail 5000 <name> 2>&1)

# Error/warning count (quick stats)
echo "${LOG_OUTPUT}" | grep -ci 'error\|exception\|fatal\|traceback'
echo "${LOG_OUTPUT}" | grep -ci 'warn'

# Last errors (up to 10 unique)
echo "${LOG_OUTPUT}" | grep -i 'error\|exception\|fatal\|traceback' | sort -u | tail -10

Step 3: Sanitize output

Before displaying log fragments to users, mask sensitive patterns:

  • Tokens, API keys, Bearer headers
  • Database connection strings with credentials
  • Passwords, secrets in environment variable dumps

Replace with [REDACTED] where detected.

Step 4: Format response

Use this template (adapt to language of request):

<status_emoji> **<container_name>**

**Status:** `running` (uptime: 2d 5h 13m)
**Restarts:** 0
**CPU:** 2.3% | **RAM:** 145MiB / 512MiB (28%)
**NET I/O:** 1.2MB / 340KB | **BLOCK I/O:** 12MB / 5MB

**Logs at last hour:**
- 🔴 Errors: 3
- ⚠️ Warnings: 12

**Last errors:**
• `ConnectionRefusedError: connect to postgres:5432`
• `TimeoutError: request took >30s`

**Recommendation:** Check access to PostgreSQL

Status emoji rules:

  • ✅ — running, 0 errors, low resource usage
  • ⚠️ — running but has warnings/errors, or high resource usage (>80% CPU/RAM)
  • 🔴 — stopped/restarting/exited, or critical errors

Restart Procedure

When asked to restart a container:

  1. Verify container is in whitelist AND can_restart: true
  2. Confirm the request is explicit (user said "restart", "перезапусти", "рестартни")
  3. Cooldown check: do not restart the same container more than once per 5 minutes. If repeated — warn and ask to confirm.
  4. Audit log: before executing, output:
   [AUDIT] <ISO-timestamp> restart <container_name> requested_by=<user_id_if_available>
  1. Execute: timeout 30 docker restart <name>
  2. Wait and verify with retries:
   for i in 1 2 3; do
     sleep 10
     STATUS=$(timeout 30 docker inspect <name> | jq -r '.[0].State.Status')
     if [ "${STATUS}" = "running" ]; then break; fi
   done
  1. If running → report success with new status
  2. If not running after 30s → report failure with last 20 log lines:

timeout 30 docker logs --tail 20 <name> 2>&1

Log Viewing

When asked to show logs:

  1. Verify container is in whitelist
  2. Apply --tail 500 limit always
  3. If user asks for filtered logs (errors only, etc.) — use grep
  4. For large output — summarize, don't dump raw
  5. Sanitize sensitive data before displaying (see Step 3 in Report Procedure)

Safety Notes

  • NEVER pass user input directly into shell commands as container names — only use exact matches from whitelist
  • Always use 2>&1 when piping docker logs (stderr contains the actual logs)
  • If DOCKER_HOST is not set, do NOT guess the address — report to user: "DOCKER_HOST is not configured. Set this environment variable to point to the docker-socket-proxy endpoint."
  • If docker command fails with connection error — report to user that docker-socket-proxy may be down

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

86.63%
按下载量换算1,344

安全审计

VirusTotal

通过

ClawScan

可疑

Static analysis

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills