跳到主内容
智客 ZICQ

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

Docker

用于发展和生产的多克集装箱化。 覆盖多克文件,多阶段建设,分层缓存,编译服务,网络,量,健康检查,安全硬化,生产部署模式.

116 安装量

官方网址:skills.sh

技能介绍

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

做什么

用于发展和生产的多克集装箱化。 覆盖多克文件,多阶段建设,分层缓存,编译服务,网络,量,健康检查,安全硬化,生产部署模式.

何时用

页:1 集成应用,创建可再生的编织环境,管好多服务堆栈,部署到集装箱平台(ECS, Kubernetes, Fly.io, Railway, Coolify)

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Docker、Overview、Quick Reference、Common Mistakes、Delegation、References。

文件分析

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

官方 description(原文)

Docker containerization for development and production. Covers Dockerfiles, multi-stage builds, layer caching, Compose services, networking, volumes, health checks, security hardening, and production deployment patterns.

DockerOverviewQuick ReferenceCommon MistakesDelegationReferences

· 许可:MIT

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
docker
description
Docker containerization for development and production. Covers Dockerfiles, multi-stage builds, layer caching, Compose services, networking, volumes, health checks, security hardening, and production deployment patterns.
许可
MIT
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。
指令中引用的文件 · 7
  • references/dockerfile-patterns.md
  • references/compose.md
  • references/security.md
  • references/buildx-and-multiplatform.md
  • references/ci-caching.md
  • references/monorepo-builds.md
  • references/debugging.md

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

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

安装这个技能

Skills CLI ↗

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

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

交给 Agent 安装

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

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

GitHub 完整包 ↗

终端安装 · Skills CLI

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

npx skills add 'https://github.com/oakoss/agent-skills' --list

npx skills add 'https://github.com/oakoss/agent-skills' --skill 'docker'

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

阅读排版

name: docker description: | Docker containerization for development and production. Covers Dockerfiles, multi-stage builds, layer caching, Compose services, networking, volumes, health checks, security hardening, and production deployment patterns.

Use when writing Dockerfiles, optimizing image size, configuring Compose services, debugging container networking, setting up health checks, hardening containers for production, or troubleshooting build cache issues. license: MIT metadata: author: oakoss version: '1.1' source: 'https://docs.docker.com' user-invocable: false

Docker

Overview

Docker packages applications into isolated containers that run consistently across environments. A Dockerfile defines the image build steps, Compose orchestrates multi-container services, and production patterns ensure small, secure, performant images.

When to use: Containerizing applications, creating reproducible dev environments, orchestrating multi-service stacks, deploying to container platforms (ECS, Kubernetes, Fly.io, Railway, Coolify).

When NOT to use: Simple static sites with no backend (use CDN deploy), single-binary CLI tools (distribute the binary), or when the target platform has native buildpacks (Heroku, Vercel) and you don't need container control.

Quick Reference

| Pattern | Approach | Key Points | | -------------------- | ---------------------------------------------- | ---------------------------------------------------- | | Multi-stage build | Separate builder and production stages | 80%+ image size reduction, no dev deps in production | | Layer caching | Copy lockfile first, install, then copy source | Dependency layer cached across builds | | Non-root user | RUN adduser + USER in final stage | Never run production containers as root | | Health check | HEALTHCHECK CMD curl or node/python check | Enables orchestrator restart on failure | | .dockerignore | Exclude node_modules, .git, .env | Smaller build context, faster builds | | Compose services | compose.yaml with service definitions | Dev environment in one command | | Compose override | compose.prod.yaml with production settings | Environment-specific config without duplication | | Named volumes | volumes: in Compose for persistent data | Survives container recreation | | Build cache mount | RUN --mount=type=cache,target=/root/.npm | Persistent cache across builds | | Secrets in build | RUN --mount=type=secret,id=token | Never bake secrets into image layers | | Image pinning | Pin to major.minor or digest | Reproducible builds, avoid surprise breakage | | Container networking | Custom bridge networks with service discovery | Containers resolve each other by service name | | Compose watch | develop.watch with sync/rebuild actions | Live reload without volume mounts | | Init process | --init flag or tini entrypoint | Proper signal handling and zombie reaping | | Multi-platform | docker buildx build --platform | ARM (Apple Silicon, Graviton) + x86 in one image | | Monorepo prune | turbo prune app --docker | Minimal build context from workspace dependencies | | CI layer caching | cache-from/cache-to with GHA or registry | Avoid full rebuilds in CI pipelines | | Debug containers | docker exec, docker logs, dive | Inspect running containers and image layers |

Common Mistakes

| Mistake | Correct Pattern | | ----------------------------------------------- | ---------------------------------------------------------------- | | Installing dev dependencies in production image | Multi-stage build: install in builder, copy artifacts to runtime | | Copying source before installing dependencies | Copy lockfile first, npm ci, then copy source for cache reuse | | Running as root in production | Create non-root user, USER directive in final stage | | Hardcoding secrets in Dockerfile or ENV | Use build secrets (--mount=type=secret) or runtime env | | Using latest tag for base images | Pin to specific version (node:24-alpine) | | No .dockerignore file | Exclude node_modules, .git, .env, build artifacts | | Using npm install instead of npm ci | npm ci for deterministic, lockfile-based installs | | HEALTHCHECK missing | Add health check for orchestrator integration | | Large base images (node:24) | Use alpine variants (node:24-alpine) for smaller images | | Ignoring .env file precedence in Compose | environment: in Compose overrides .env file values | | Building entire monorepo for one service | Use turbo prune --docker for minimal build context | | No layer caching in CI | Use cache-from/cache-to with GHA or registry backend | | Building only for x86 when deploying to ARM | Use docker buildx with --platform linux/amd64,linux/arm64 |

Delegation

  • Dockerfile review: Use Task agent to audit Dockerfiles for size, security, and caching
  • Compose exploration: Use Explore agent to discover existing Docker configurations
  • Architecture decisions: Use Plan agent for container orchestration strategy

If the ci-cd-architecture skill is available, delegate CI/CD pipeline and deployment strategy to it. If the application-security skill is available, delegate container security scanning and hardening review to it.

References

相关技能

安全测试

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