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

docker-container-rerunDocker container rerun 部署

Agent Skill

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

总安装

3,619

周安装

145

GitHub Stars

1

下载量

1,172
OpenClaw

安装说明

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

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

ClawHubOpenClaw
openclaw skills install docker-container-rerun

简介

智能判断是否需要重建 Docker 容器,仅在镜像变更时重跑。

  • 适合 CI/CD 和持续部署,减少不必要的重启开销。
  • 通过 clawhub 安装后在 OpenClaw 中调用,需提供原始 run 命令。
  • 依赖容器元数据记录,首次使用前建议清理旧数据。
  • docker-container-rerun 属于运维类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

name
docker-container-rerun
description
Safely check whether a Docker container's image has changed and, only when needed, recreate that docker run container with a user-provided original docker run command. Use when updating an existing Docker container managed by docker run, especially when the user provides a fixed recreate_command and wants image Id (sha256) comparison before pull/recreate. Do not use for docker compose, automatic command reconstruction, volume pruning, or speculative container changes.

Docker Container Rerun

Update a docker run container with a conservative workflow.

Required Inputs

Require both of these from the user:

  • container_name
  • recreate_command

Treat recreate_command as the source of truth. Do not try to reconstruct missing flags from docker inspect.

Scope

Support only containers originally managed by docker run.

Do not use this skill for:

  • docker compose
  • guessing or synthesizing missing run flags
  • deleting volumes
  • docker system prune
  • changing environment variables, mounts, ports, labels, or networks unless the user explicitly changed the recreate command

Update Rule

Always compare image Id values, not repo digests.

Use this exact logic:

  1. Read current image Id from the running container:
   docker inspect -f '{{.Image}}' <container_name>
  1. Extract the image reference from recreate_command.
  2. Pull the latest version of that image:
   docker pull <image>
  1. Read the latest local image Id:
   docker image inspect <image> --format '{{.Id}}'
  1. Recreate the container only if the two Id values differ.

Safety Rules

Before any destructive action, restate the exact recreate command that will be used.

If recreate_command is missing, ambiguous, or not clearly a docker run command, stop and ask the user to provide a valid full command.

If the image cannot be extracted from recreate_command, stop and ask the user to provide the image explicitly inside the command.

Never silently modify the recreate command.

Prefer this sequence when update is needed:

docker stop <container_name>
docker rm <container_name>
<recreate_command>

Validation of recreate_command

Before using it, verify all of the following:

  • starts with docker run
  • includes an image name as the final image argument before any container command
  • clearly targets the same logical container the user wants updated

If the command includes an inline container command after the image, preserve it exactly.

If the command is multiline, preserve it exactly.

Recommended Execution Workflow

  1. Confirm the target container name.
  2. Echo back the exact recreate command.
  3. Extract the image from the recreate command.
  4. Compare current image Id and latest pulled image Id.
  5. If Ids match, report that the container is already up to date and do nothing else.
  6. If Ids differ:

- run docker stop <container_name> - run docker rm <container_name> - run the exact recreate_command

  1. Verify startup with:
   docker ps --filter name=<container_name>
   docker inspect <container_name>
   docker logs --tail 100 <container_name>
  1. Report status clearly, including whether healthcheck is healthy, starting, or absent.

Bundled Script

Use the bundled script when you want a deterministic check/apply flow:

python3 scripts/update_docker_run_container.py \
  --container-name <container_name> \
  --recreate-command '<full docker run command>'

Add --apply only when the user has approved the exact recreate command and actual recreation should happen.

The script will:

  • validate recreate_command
  • extract the image
  • pull the latest image
  • compare current vs latest image Id
  • optionally stop/remove/recreate
  • emit JSON summary with container state, health status, and recent logs

Output Expectations

When reporting results, include:

  • target container name
  • extracted image name
  • current image Id
  • latest image Id
  • whether recreation was needed
  • post-recreate container state
  • health status if present
  • any obvious log errors seen in recent logs

Example Pattern

Input:

  • container_name: my-container
  • recreate_command:
  docker run -d --network host --name my-container --restart unless-stopped -v example_data:/data -v example_certs:/etc/ssl/certs -e DB_HOST=<db_host> -e DB_PORT=<db_port> -e DB_NAME=<db_name> -e DB_USER=<db_user> -e DB_PASSWORD=<db_password> --health-cmd="/bin/check-health" --health-interval=600s --health-retries=5 --health-timeout=3s example/image:latest

Expected behavior:

  • extract image example/image:latest
  • compare current container image Id vs pulled latest image Id
  • recreate only if the Ids differ
  • preserve the recreate command exactly

Notes

When users ask to "update container X", prefer asking for the original docker run command unless it is already documented in memory or provided in the current request.

If the user has a known fixed recreate command for a specific container, prefer using that exact command unchanged.

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

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

04

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

能力 5

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

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

平台分布

OpenClaw

96.44%
按下载量换算1,130

安全审计

VirusTotal

可疑

ClawScan

通过

Static analysis

通过

权限和风险

敏感数据

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

安装前确认

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

来源信息

继续浏览同类 Skills