跳到主内容
智客 ZICQ

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

Docker

多克容器化参考——多相相建构,编译配置,图像优化,并用于Yarn 4 monrepos的容器安全. 使用时:(1)创建或优化多克文件,(2)为dev或生产配置多克编组,(3)用多相构件来缩小图像大小,(4)加固容器安全,或(5)设置健康检查和资源限制.

24 安装量

官方网址:skills.sh

技能介绍

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

做什么

Docker 容器化参考——多相相建构,编译配置,图像优化,以及 Yarn 4 单相的容器安全

何时用

(1) 创建或优化多克文件,(2) 为 Dev 或生产配置多克文件,(3) 用多级建筑减少图像大小,(4) 强化容器安全,或(5) 设置健康检查和资源限制

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Docker — Containerization for Monorepos、Key Principles、Image Optimization Quick Reference、Container Security Quick Reference、Useful Commands、When to Load References。

文件分析

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

官方 description(原文)

Docker containerization reference — multi-stage builds, Compose configs, image optimization, and container security for Yarn 4 monorepos. Use when: (1) creating or optimizing Dockerfiles, (2) configuring docker-compose for dev or production, (3) reducing image size with multi-stage builds, (4) hardening container security, or (5) setting up health checks and resource limits.

Docker — Containerization for MonoreposKey PrinciplesImage Optimization Quick ReferenceContainer Security Quick ReferenceUseful CommandsWhen to Load References

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
docker
description
Docker containerization reference — multi-stage builds, Compose configs, image optimization, and container security for Yarn 4 monorepos. Use when: (1) creating or optimizing Dockerfiles, (2) configuring docker-compose for dev or production, (3) reducing image size with multi-stage builds, (4) hardening container security, or (5) setting up health checks and resource limits.
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。
指令中引用的文件 · 2
  • references/monorepo-dockerfile.md
  • references/compose-configs.md

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

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

安装这个技能

Skills CLI ↗

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

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

交给 Agent 安装

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

把 Agent Skill「docker」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-0bce0fcbf55dd478-%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/jgamaraalv/ts-dev-kit 取完整目录,不要只建一个 SKILL.md。

GitHub 完整包 ↗

终端安装 · Skills CLI

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

npx skills add 'https://github.com/jgamaraalv/ts-dev-kit' --list

npx skills add 'https://github.com/jgamaraalv/ts-dev-kit' --skill 'docker'

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

阅读排版
--- name: docker description: "Docker containerization reference — multi-stage builds, Compose configs, image optimization, and container security for Yarn 4 monorepos. Use when: (1) creating or optimizing Dockerfiles, (2) configuring docker-compose for dev or production, (3) reducing image size with multi-stage builds, (4) hardening container security, or (5) setting up health checks and resource limits." --- # Docker — Containerization for Monorepos Docker best practices for Node.js monorepos with Yarn 4 Berry. ## Key Principles - **Minimal images**: Alpine-based, only runtime dependencies in final stage - **Layer caching order**: system deps → package manifests → install → source → build - **Non-root users**: Create `app` user, never run as root in production - **One process per container**: Compose multiple containers, not multiple processes - **Health checks on every service**: Use the existing `/health` endpoint ## Image Optimization Quick Reference - Use `node:22-alpine` as base - Multi-stage builds: exclude build tools from final image - `yarn cache clean` after install - `.dockerignore`: exclude `.git`, `node_modules`, `*.md`, `.env*`, `.claude`, `__tests__`, `coverage`, `.turbo` - `--production` flag for runtime dependencies only - Pin base image versions (not just `latest`) ## Container Security Quick Reference - Run as non-root user (`addgroup --system app && adduser --system --ingroup app app`) - Don't store secrets in images — use env vars or secrets management - Scan images: `docker scout cves ` - Set resource limits in compose: `mem_limit`, `cpus` - Read-only filesystem where possible: `read_only: true` - Drop capabilities: `cap_drop: [ALL]` ## Useful Commands ```bash docker compose build api # Build specific service docker compose up -d # Start all services docker compose logs -f api # Follow logs docker compose exec api sh # Shell into container docker images | grep myapp # Check image sizes docker system df # View cache usage docker system prune -a # Prune unused images docker stats # Resource usage ``` ## When to Load References | Need | Reference file | | -------------------------------------------------- | ---------------------------------------------------------------------- | | Writing or reviewing a Dockerfile for the monorepo | [references/monorepo-dockerfile.md](references/monorepo-dockerfile.md) | | Configuring docker-compose for dev or production | [references/compose-configs.md](references/compose-configs.md) |

相关技能

安全测试

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