360 Secure SkillHub
360 安全技能中心

Container Update Advisor

扫描本机运行中的 Docker 容器及其镜像标签,对照 Docker Hub 查询较新版本,抓取 GitHub 发布说明判断是否含破坏性变更,最后输出带高风险/安全标记的优先级 Markdown 更新报告。会跳过 latest 标签、digest 固定镜像、非 Docker Hub 仓库与语义化版本之外的标签。可选设置 GITHUB_TOKEN 以提高 GitHub API 配额。

newageinvestments25-byte
newageinvestments25-byte
热度 45.85
最近更新 2026-05-11 17:38:19
分类:开发依赖:代码执行 / 读写文件 / 第三方 API应用场景:DevOps / 报告撰写 / 自动化脚本 / API 集成 ...

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add container-update-advisor
Metadata
name
container-update-advisor
description
Check running Docker containers for newer image versions and generate a prioritized update report. Fetches release notes and flags breaking changes vs safe updates. Use when asked about container updates, docker updates, outdated containers, update check, what needs updating, are my containers up to date, or any request to review Docker image versions.

Container Update Advisor

Check all running Docker containers against Docker Hub for newer versions, fetch changelogs, and output a prioritized markdown report with risk flags.

Scripts

All scripts live in scripts/ relative to this file. Run from that directory.

Script Purpose
scan_containers.py List running containers + image tags (outputs JSON)
check_updates.py Query Docker Hub for newer versions (stdin/file → JSON)
fetch_changelog.py Fetch GitHub release notes for updated images (stdin/file → JSON)
format_report.py Render prioritized markdown report (stdin/file → stdout)

Full Pipeline

python3 scan_containers.py \
  | python3 check_updates.py \
  | python3 fetch_changelog.py \
  | python3 format_report.py

To save intermediate output for debugging, pass each script's output as a file argument to the next:

python3 scan_containers.py > /tmp/c.json
python3 check_updates.py /tmp/c.json > /tmp/u.json
python3 fetch_changelog.py /tmp/u.json > /tmp/ch.json
python3 format_report.py /tmp/ch.json

Risk Assessment Logic

  • Major version bump → 🔴 review first
  • Minor version bump → 🔴 review first (may have API changes)
  • Changelog mentions "breaking" → 🔴 review first
  • Patch bump only, no breaking keywords → 🟢 safe to update

What Gets Skipped

  • Containers using latest tag (no version to compare)
  • Digest-pinned images (sha256:... tags)
  • Non-Docker Hub registries (GHCR, ECR, etc.)
  • Private images (401/403 → skipped gracefully)
  • Non-semver tags (e.g. alpine, focal, slim)

GitHub Token (Optional)

Set GITHUB_TOKEN env var to increase GitHub API from 60 → 5,000 req/hr:

export GITHUB_TOKEN=ghp_yourtoken

Reference

See references/setup-guide.md for scheduling, rate limits, and how image matching works.