跳到主内容
智客 ZICQ

技能库 智客分类:安全测试 docker

Docker

书写和改变集装箱基础设施,如这一项目已经建立和运送的方式,而不是一般的默认情况——一个Docker参考文件,载有Dockerfile、多阶段建筑、编译服务、联网、量、健康检查、登记、BuildKit、安全加固、CI/CD集成以及调试等实际惯例。 持有能保持图像小而安全的不变体:多相相相建构,非自根运行时间,被钉入底相,没有被烘烤出的秘密,是强制性的.dockerignore,以及被冻结的锁文件——这样一相相相相相相相相相接会降落出小而有安全性,可再生,并可以审查准备,而不仅仅是建筑相接. 当任务触及到容器配置、图像或部署基础设施时使用.

119 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

书写和改变集装箱基础设施,如这一项目已经建立和运送的方式,而不是一般的默认情况——一个Docker参考文件,载有Dockerfile、多阶段建筑、编译服务、联网、量、健康检查、登记、BuildKit、安全加固、CI/CD集成以及调试等实际惯例。 持有保存图像小而安全的变相器:多相相建构,非自根运行时间,被钉入底像,没有被烘烤出的秘密,强制性的.dockerignore,和被冻结的锁文件——因此一幅图像会降落在小而安全,可再生产,并进行审查准备而不只是建筑

何时用

任务触及容器配置、图像或部署基础设施

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:docker、Inputs、Goal、Step 0: Read the stack contract、Step 1: Load only the relevant references、Step 2: Implement with the core Docker guardrails。 其中含规范建议的小节:分步指令。

文件分析

文件分析:除 SKILL.md 外,正文引用了 references/stack.md、references/dockerfile.md、references/multi-stage.md、references/compose.md、references/build-context.md、references/health-checks.md,属于带资源的技能包,这些文件按需再读。

官方 description(原文)

Write and change container infrastructure the way THIS project already builds and ships it, not by generic defaults — a Docker reference carrying the real conventions for Dockerfiles, multi-stage builds, Compose services, networking, volumes, health checks, registries, BuildKit, security hardening, CI/CD integration, and debugging. Holds the invariants that keep images small and safe: multi-stage builds, non-root runtime, pinned base images, no baked secrets, a mandatory .dockerignore, and frozen lockfiles — so an image lands small, secure, reproducible, and review-ready instead of merely building. Use when a task touches container configuration, images, or deployment infrastructure.

dockerInputsGoalStep 0: Read the stack contractStep 1: Load only the relevant referencesStep 2: Implement with the core Docker guardrailsStep 3: Verify the buildGuardrailsWhen To Load ReferencesOutput Contract

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
docker
description
Write and change container infrastructure the way THIS project already builds and ships it, not by generic defaults — a Docker reference carrying the real conventions for Dockerfiles, multi-stage builds, Compose services, networking, volumes, health checks, registries, BuildKit, security hardening, CI/CD integration, and debugging. Holds the invariants that keep images small and safe: multi-stage builds, non-root runtime, pinned base images, no baked secrets, a mandatory .dockerignore, and frozen lockfiles — so an image lands small, secure, reproducible, and review-ready instead of merely building. Use when a task touches container configuration, images, or deployment infrastructure.
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。
指令中引用的文件 · 10
  • references/stack.md
  • references/dockerfile.md
  • references/multi-stage.md
  • references/compose.md
  • references/build-context.md
  • references/health-checks.md
  • references/security.md
  • references/image-optimization.md
  • references/registry.md
  • references/buildkit.md

以下路径提取自原文;文件是否齐全请以来源仓库中的完整目录为准。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

该技能引用了附属文件,请从来源获取完整目录;仅复制 SKILL.md 可能缺少依赖。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「docker」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-c1f9b173da6b4953-%E5%A4%B9%E5%85%8B.html
请存为 .cursor/skills/docker/SKILL.md 或 .claude/skills/docker/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。
该技能还带 scripts/、references/、assets/ 等文件,请从 https://github.com/ulpi-io/skills 取完整目录,不要只建一个 SKILL.md。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/ulpi-io/skills' --list

npx skills add 'https://github.com/ulpi-io/skills' --skill 'docker'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版
--- name: docker version: 1.1.0 description: | Write and change container infrastructure the way THIS project already builds and ships it, not by generic defaults — a Docker reference carrying the real conventions for Dockerfiles, multi-stage builds, Compose services, networking, volumes, health checks, registries, BuildKit, security hardening, CI/CD integration, and debugging. Holds the invariants that keep images small and safe: multi-stage builds, non-root runtime, pinned base images, no baked secrets, a mandatory .dockerignore, and frozen lockfiles — so an image lands small, secure, reproducible, and review-ready instead of merely building. Use when a task touches container configuration, images, or deployment infrastructure. allowed-tools: - Bash - Read - Write - Edit - Grep argument-hint: "[Docker task: Dockerfile, Compose, registry, debugging]" arguments: - request when_to_use: | Use when the task touches Dockerfiles, docker-compose, container configuration, image builds, registry workflows, or container debugging. Examples: "write a Dockerfile", "optimize this image", "add a service to compose", "debug why the container won't start", "set up multi-stage build", "push to ECR/GCR", "add health checks". Do NOT use for Kubernetes manifests (k8s skill) or for application code that happens to run in containers — it configures the container, not the app. effort: high --- This skill is a routing shell over the Docker reference set. Non-negotiable rules: 1. Read `references/stack.md` first to determine the project's base images, registry, and build conventions. 2. Then load only the references needed for the actual task. 3. **Multi-stage builds by default** — separate dependency install, build, and production stages. 4. **Non-root user in production** — never run containers as root. Add a user and `USER` directive. 5. **No secrets in images** — no `ARG`/`ENV` for passwords, no `COPY .env`, no secrets in build layers. 6. **Pin base image versions** — `node:22-slim`, not `node:latest`. Use digest pinning for critical images. 7. **`.dockerignore` is mandatory** — exclude `node_modules`, `.git`, `.env`, `dist`, test artifacts. 8. **Frozen lockfiles in builds** — `--frozen-lockfile` / `--ci` for reproducible installs. # docker ## Inputs - `$request`: The Docker task — Dockerfile, Compose, registry, optimization, or debugging target ## Goal Route Docker work through proven container patterns so images are small, secure, reproducible, and follow the project's infrastructure conventions. ## Step 0: Read the stack contract Always start with: - `references/stack.md` That establishes: base images, registry, build tool (Docker/BuildKit/Podman), CI integration, and locked conventions. **Success criteria**: The project's container infrastructure choices are explicit before writing any Dockerfile or Compose config. ## Step 1: Load only the relevant references Use the routing table to pick reference files. Do not bulk-load the full reference tree. | Task | Read | |------|------| | Base images, registry, build conventions, CI | `references/stack.md` | | Writing or editing a Dockerfile | `references/dockerfile.md` | | Multi-stage builds, layer optimization, caching | `references/multi-stage.md` | | docker-compose services, networking, volumes | `references/compose.md` | | .dockerignore, build context optimization | `references/build-context.md` | | Health checks, readiness, startup probes | `references/health-checks.md` | | Security: non-root, read-only FS, capabilities, scanning | `references/security.md` | | Image size optimization, distroless, slim, alpine | `references/image-optimization.md` | | Registry: push, pull, tagging, ECR/GCR/GHCR/DockerHub | `references/registry.md` | | BuildKit features, cache mounts, secret mounts | `references/buildkit.md` | | CI/CD: GitHub Actions, GitLab CI, build+push pipelines | `references/ci-cd.md` | | Debugging: logs, exec, inspect, networking issues | `references/debugging.md` | | Language-specific: Node.js, Python, Go, Rust, Java | `references/language-patterns.md` | | Volumes, bind mounts, tmpfs, named volumes | `references/volumes.md` | | Networking: bridge, host, overlay, DNS, port mapping | `references/networking.md` | Multiple tasks? Read multiple files. The references are self-contained. **Success criteria**: Only the task-relevant Docker conventions are in play. ## Step 2: Implement with the core Docker guardrails Keep these rules active: - multi-stage builds: deps → build → production - `.dockerignore` excludes everything unnecessary from build context - pin base image tags — never `:latest` in production - non-root `USER` in the final stage - `COPY` only what's needed in each stage — not the entire repo - health checks on every long-running service - no secrets in `ARG`, `ENV`, or `COPY` — use BuildKit `--mount=type=secret` - combine `RUN` commands to minimize layers — but keep readability - order layers from least to most frequently changing (deps before code) **Success criteria**: The container is small, secure, reproducible, and follows the project's conventions. ## Step 3: Verify the build Use the narrowest relevant verification: - `docker build` succeeds - image size is reasonable for the language/framework - container starts and health check passes - `.dockerignore` excludes the right files (`docker build --dry-run` or check context size) - no secrets visible in `docker history` or `docker inspect` **Success criteria**: The image builds, runs, and passes basic health validation. ## Guardrails - Do not inline the whole Docker handbook in `SKILL.md`. - Do not skip `references/stack.md`. - Do not use `latest` tags for base images in production Dockerfiles. - Do not `COPY . .` without a proper `.dockerignore`. - Do not run containers as root. - Do not put secrets in build args or env vars baked into images. - Do not add `disable-model-invocation`; this is a normal domain skill. ## When To Load References - `references/stack.md` Always. - then only the task-relevant files under `references/` ## Output Contract Report: 1. which Docker references were loaded 2. the build pattern chosen (multi-stage, single, etc.) 3. the change made 4. the verification run (build success, image size, health check)

相关技能

安全测试

Skill Vetter

人工智能特工的安全第一技能审查。 在安装来自 ClawdHub, GitHub 或其他来源的任何技能之前使用 。 检查红旗,许可范围,可疑图案.

安全测试

Moltguard

MoltGuard——由OpenGuardrails担任OpenClaw保安. 安装 MoltGuard 以保护你和你的人类免受迅速注射、数据过滤和恶意命令的影响。 资料来源:https://github.com/openguardrails/openguardrails/tre…

安全测试

Security Auditor

用于审查安全漏洞代码,实施认证流,审计OWASP Top 10,配置CORS/CSP头,处理秘密,输入验证,SQL注射预防,XSS保护,或任何与安全相关的代码审查.

安全测试

Skill Vetter

安装任何AI代理技能前的安全审查协议. 红旗侦取入证盗取,疏通密码,放出. 风险分类:低/中/高/高。 编制结构化审查报告。 不先运行此功能, 绝不安装不信任的技能 .