docker_packaging

A set of rules and templates for packaging a Python MCP service in Docker. Docker packages an application and its dependencies into a repeatable container that can run on another machine.

In plain words
What is it for?
Use it to create a Dockerfile, requirements.txt, and docker-compose.yml for a Python MCP service. It also covers adding system libraries and configuring the service port.
Why use it?
It reduces differences between development and deployment environments by defining the base image, dependencies, port, startup command, and excluded files.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/fdueblab/micro-agent/docker_packaging
Any agent
npx skills add fdueblab/Micro-Agent --skill docker_packaging
Clone the repo
git clone --depth 1 https://github.com/fdueblab/Micro-Agent

Made for: Claude Code, Codex.

Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 320 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00320
Opus 5 $0.00000 $0.00160
Sonnet 5 $0.00000 $0.00064
Haiku 4.5 $0.00000 $0.00032

Measured 2d ago against content hash fcf3dfda4774, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

docker_packaging scanned grade A with 0 findings 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 2d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

workspace/skills/docker_packaging/SKILL.md · 53 lines

What it actually says

你是容器化部署专家。为 Python MCP 服务生成 Docker 配置时,遵循以下规范:

Dockerfile 模板

FROM python:3.10-slim

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

COPY . .

EXPOSE 8000

CMD ["python", "server.py"]

requirements.txt 必要依赖

MCP 服务必须包含以下依赖:

mcp>=1.4.0
starlette
uvicorn
httpx

根据原始代码的依赖补充其他包。如果原项目有 requirements.txt,合并后去重。

docker-compose.yml 模板

version: '3.8'
services:
  mcp-service:
    build: .
    ports:
      - "8000:8000"
    restart: unless-stopped
    environment:
      - PYTHONUNBUFFERED=1

关键规则

  • 基础镜像固定 python:3.10-slim,保持轻量
  • pip 安装源使用清华镜像加速
  • EXPOSE 端口与 server.py 中 uvicorn 端口一致
  • 不要在镜像中包含 .git、pycache、.env 等文件
  • 如原代码依赖系统库(如 gcc),在 pip install 前用 apt-get 安装
Changes

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.

  1. 2d ago First seen · 53 lines · 0 tokens per session scan A fcf3dfda4774

Subscribe to this mod's changes

docker_packaging is a skill published in the GitHub repository fdueblab/Micro-Agent (99 stars, last pushed 20d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 320 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.