Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/Morningstar202604/awesome-skillkitnpx agentmods add skills/morningstar202604/awesome-skillkit/docker-developmentWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/morningstar202604/awesome-skillkit/docker-development)<a href="https://agentmods.dev/skills/morningstar202604/awesome-skillkit/docker-development"><img src="https://agentmods.dev/badge/skills/morningstar202604/awesome-skillkit/docker-development/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/morningstar202604/awesome-skillkit/docker-development"><img src="https://agentmods.dev/badge/skills/morningstar202604/awesome-skillkit/docker-development.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00117 | $0.03963 |
| Opus 5.5 | $0.00047 | $0.01585 |
| Sonnet 5.5 | $0.00023 | $0.00793 |
| Haiku 4.5 | $0.00012 | $0.00396 |
Grade B, and why
docker-development scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 28d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Recursive force deletemediumDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
- **apt-get 未在同一层清理** → 同一 RUN 里加 `rm -rf /var/lib/apt/lists/*`。 Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.
This is a copy
97% identical to docker-development — 415 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 322 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Docker Development
更小的镜像。更快的构建。更安全的容器。不靠猜。
一套带明确主张的 Docker 工作流,把臃肿的 Dockerfile 变成生产级容器。覆盖优化、多阶段构建、compose 编排与安全加固。
这不是 Docker 教程——这是一组具体决策,关于如何构建不浪费时间、不占空间、不扩大攻击面的容器。
斜杠命令
| 命令 | 作用 |
|---|---|
/docker:optimize |
分析并优化 Dockerfile 的体积、速度与层缓存 |
/docker:compose |
按最佳实践生成或改进 docker-compose.yml |
/docker:security |
审计 Dockerfile 或运行中容器的安全问题 |
何时激活
识别用户的这些表达:
- "Optimize this Dockerfile"
- "My Docker build is slow"
- "Create a docker-compose for this project"
- "Is this Dockerfile secure?"
- "Reduce my Docker image size"
- "Set up multi-stage builds"
- "Docker best practices for [language/framework]"
- 任何涉及 Dockerfile、docker-compose、容器、镜像体积、构建缓存、Docker 安全的请求
用户有 Dockerfile,或想把某个东西容器化 → 本技能适用。
输入清单
| 输入 | 必需 | 说明 |
|---|---|---|
| Dockerfile 路径 | 视情况 | /docker:optimize 与 /docker:security 的目标(默认 cwd 下的 Dockerfile) |
| 服务拓扑 | 视情况 | 各服务及其角色,用于 /docker:compose |
| 基础镜像约束 | 可选 | Registry、glibc/musl 需求、是否偏好带 shell 便于调试 |
| 暴露端口 / 卷 / 环境变量 | 可选 | 应用所需,用于 compose 生成 |
| 开发还是生产意图 | 可选 | 决定 bind mounts vs named volumes、调试端口、重启策略 |
缺输入时一次性收集:"请一次性提供:① Dockerfile 或要容器化内容的描述 ② 需要哪些服务(app/database/cache/queue/proxy)③ 端口、卷与必需的环境变量 ④ 这是本地开发还是类生产环境。其余我按下方清单决定。"
前置自检
先探测再动手;任一失败,给出修复方法并停止:
python3 --version # 预期 3.8+;失败:安装 python3
# 自检:python3 scripts/dockerfile_analyzer.py --help 与 compose_validator.py --help 均预期退出码 0
test -f <Dockerfile-path> # optimize/security 任务预期退出码 0;失败:向用户要文件
docker --version >/dev/null 2>&1 # 预期退出码 0;失败:docker 未安装 → 跳过构建/验证步骤,仅做静态分析
工作流
步骤 1:分析现有 Dockerfile(/docker:optimize)
读 Dockerfile;识别基础镜像及其体积;数层(每个 RUN/COPY/ADD = 1 层);记下反模式。然后套用优化清单:
BASE IMAGE
├── 用具体 tag,生产环境绝不用 :latest
├── 优先 slim/alpine 变体(debian-slim > ubuntu > debian)
├── CI 里用 digest 锁定保证可复现:image@sha256:...
└── 基础镜像匹配运行时需求(编译好的二进制别用 python:3.12)
LAYER OPTIMIZATION
├── 相关 RUN 命令用 && \ 合并
├── 层排序:变化最少的在前(依赖先于源码)
├── 包管理器缓存在同一 RUN 层内清理
├── 用 .dockerignore 排除无关文件
└── 构建依赖与运行时依赖分离
BUILD CACHE
├── 先 COPY 依赖文件再 COPY 源码(package.json、requirements.txt、go.mod)
├── 依赖安装与代码拷贝分属不同层
├── 用 BuildKit cache mount:--mount=type=cache,target=/root/.cache
└── 依赖安装之前避免 COPY . .
MULTI-STAGE BUILDS
├── 阶段 1:build(完整 SDK、构建工具、开发依赖)
├── 阶段 2:runtime(最小基础镜像,只要生产产物)
├── COPY --from=builder 只拿需要的
└── 最终镜像应无构建工具、无源码、无开发依赖
What ships with it
7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago Changed · -7 tokens per session e7abc7cdcf4f
- 1mo ago Changed · -1 lines 8faa4072d4f1
- 1mo ago Changed · -45 lines · +33 tokens per session 7f340f8810d6
- 1mo ago First seen · 368 lines · 84 tokens per session scan B 57dcae43ffa5
docker-development is a skill published in the GitHub repository Morningstar202604/awesome-skillkit (0 stars, last pushed 25d ago), licensed Apache-2.0. It adds 117 tokens to every session and 3,963 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it B with 1 finding (recursive force delete). It is 97% identical to docker-development, differing in 415 lines, and is treated as a copy.
Other skills, from other repositories
docker-management
Manage Docker containers, images, volumes, and Compose.
deployment-patterns
Deployment workflows, CI/CD pipeline patterns, Docker containerization, health checks, rollback strategies, and production readiness checklists for web applications. Use when setting up deployment infrastructure or planning releases.
docker-patterns
Docker and Docker Compose patterns for local development, container security, networking, volume strategies, and multi-service orchestration. Use when setting up containerized development environments or reviewing Docker configurations.
deploy-docker-compose
Run the Omnigent server as a Docker compose stack (server + Postgres) on any Docker host — your laptop, a VPS, EC2 by hand, or as the base layer of any container-platform deploy. Invoke when the user wants to build the image, bring up the compose stack, debug the stack on a host they already have, or extend the stack…
workspaces
How an Open SWE workspace's sandbox image works and how to change it — create one, edit or fork an existing one, start from scratch, what setupscript and updatescript are for, why a nightly refresh failed, where the build logs are, and how to read a rebuild in progress. Read this whenever someone asks about…
langbot-deploy
Deploy and configure a LangBot instance — Docker / Docker Compose, Kubernetes, the config.yaml model, the Box sandbox runtime, the plugin runtime, and the global API key. Use when installing, deploying, upgrading, or configuring LangBot in production or self-hosted environments. Triggers on "deploy langbot", "langbot…