跳到主内容
智客 ZICQ

技能库 智客分类:运维与云 docker

Docker

将一个 CEDA 应用到家 —— 一个基于 uv 的 Python 图像,非 root runtime 用户, 被绑住的 apt 包, 以及用于本地 dev 的 Docker 编组 。 在 CEDA repo 中添加或编辑 Dockerfile / docker-compose.yml 时使用,或者调试容器构造.

8 安装量

官方网址:skills.sh

技能介绍

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

做什么

将一个 CEDA 应用套件装入内部 —— 一个基于 uv 的 Python 图像, 非 root 运行时用户, 被绑住的 apt 包, 以及一个用于本地 dev 的 Docker 编组

何时用

在 CEDA repo 中添加或编辑 Dockerfile / docker-compose.yml, 或调试容器构建

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:docker、When this applies、Image conventions、Best practices (from docs/gitlab.md)、Lint before committing、docker-compose (local dev)。

文件分析

文件分析:这是一份仅含 SKILL.md 的指令型技能,代理激活后整份正文进入上下文。

官方 description(原文)

Containerize a CEDA app the house way — a uv-based Python image, non-root runtime user, pinned apt packages, and a docker-compose for local dev. Use when adding or editing a Dockerfile / docker-compose.yml in a CEDA repo, or debugging a container build.

dockerWhen this appliesImage conventionsBest practices (from docs/gitlab.md)Lint before committingdocker-compose (local dev)Important

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
docker
description
Containerize a CEDA app the house way — a uv-based Python image, non-root runtime user, pinned apt packages, and a docker-compose for local dev. Use when adding or editing a Dockerfile / docker-compose.yml in a CEDA repo, or debugging a container build.
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。

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

安装这个技能

Skills CLI ↗

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

交给 Agent 安装

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

把 Agent Skill「docker」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-2898f6baec16632a-%E5%A4%B9%E5%85%8B.html
请存为 .cursor/skills/docker/SKILL.md 或 .claude/skills/docker/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。

GitHub 完整包 ↗

终端安装 · Skills CLI

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

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

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

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

阅读排版
--- name: docker description: Containerize a CEDA app the house way — a uv-based Python image, non-root runtime user, pinned apt packages, and a docker-compose for local dev. Use when adding or editing a Dockerfile / docker-compose.yml in a CEDA repo, or debugging a container build. --- # docker CEDA repos ship a Dockerfile + docker-compose per repo. Match the existing conventions (grounded in the GitLab `text-analysis` repo's `Dockerfile` and its `docs/gitlab.md`); read the target repo's current Dockerfile first. ## When this applies This is a **knowledge skill** — it loads (explicitly via `/docker`, or automatically) when you add or edit a `Dockerfile` / `docker-compose.yml`, or debug a container build in a CEDA repo. It is reference/convention. ## Image conventions - **Base:** `python:3.12-slim` (multi-arch: `FROM --platform=${BUILDPLATFORM} ...`). - **Security updates:** `apt-get update && apt-get -y upgrade`, install only what's needed with `--no-install-recommends`, and **pin apt package versions** (`cron=3.0pl1-162`, …). End the layer with `rm -rf /var/lib/apt/lists/*`. - **uv for deps:** copy `pyproject.toml` + `uv.lock`, then `uv sync --frozen --no-dev`. (Older repos `pip install -r requirements.txt`; match what the repo uses.) - **Non-root runtime.** Create a user (`useradd -m streamlit`), `chown` what it needs, `USER ` before the app runs. Never run the service as root. - **Entrypoint** for Streamlit apps: `CMD ["uv", "run", "streamlit", "run", "src/main.py"]`. ## Best practices (from docs/gitlab.md) 1. Multi-stage builds to shrink the image where it helps. 2. Combine related `RUN` commands to reduce layers. 3. Specific version tags on the base image (not `latest`). 4. Remove build-only deps after use. 5. Non-root user (see above). 6. Include a healthcheck (compose or Dockerfile) — Streamlit apps expose `/healthz`. ## Lint before committing ```bash hadolint Dockerfile ``` ## docker-compose (local dev) - Env comes from a **`.env`** file (gitignored); compose references `${VAR}` (e.g. `MINIO_*`, `SURFDRIVE_*` — see /surfdrive). - Bind-mount `src/` for live editing during dev. - Common commands: ```bash docker compose build docker compose up # -d for detached docker compose down # -v to drop volumes docker exec -ti bash # shell in; -u root for maintenance ``` ## Important - **Match the repo's existing Dockerfile** (uv vs pip, base image) rather than imposing a different toolchain. - **Run the service as a non-root user** and pin apt package versions. - A local `docker compose up` validates the image builds and starts — it does NOT prove deployed behavior on SDP (that's Flux/GitLab CI; see /surf-sdp-helm-flux). Verify the container actually serves before calling it done. - Applies to cedanl repos.

相关技能

运维与云

Docker Essentials

用于容器管理,图像操作,调试的基本道克命令和工作流程.

运维与云

Find Skills

从开放的代理技能生态系统中发现并安装技能. 使用时:(1)用户问"我如何做X",X可能拥有现有技能,(2)用户说"为X找到技能"或"是否为X有技能",(3)用户问"你能否做X",X是专门能力,(4)用户想扩展代理能力,(5)用户想搜索工具,模板,或工作流程,(6)用户提到他们希望…

运维与云

Microsoft Foundry

构建,部署,评价,优化,微调,管理微软创始代理,模型,资源最终结束. 用法:铸造、azd ai代理、azd 提供/部署、托管代理脚手架/开发/运行/部署/拖放、即时代理创建、创建代理、更新代理、添加代理工具、援引代理、代理.yaml、评估代理、批量活化、连续活化、持续监测、代理C…

运维与云

Azure Deploy

执行已有.azure/部署计划.md和基础设施文件的ALREADY-PREPARED应用程序的Azure部署。 当用户向 CREATE 请求新应用程序时, 请不要使用此技能 。 这种技能运行了 azd上行, azd 部署, trarraform 应用, 和 az 部署命令带有内置…