docker-compose
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDocker Compose Skill
Docker Compose 技能文档
Installation
安装步骤
The skill invokes . Easiest: install Docker Desktop (includes Docker Engine + Compose):
docker compose- Windows: Docker Desktop for Windows (WSL 2 or Hyper-V)
- Mac: Docker Desktop for Mac (Apple Silicon or Intel)
- Linux: Docker Desktop for Linux or Docker Engine + Compose plugin from Docker's repo
Verify:
docker compose version本技能调用命令。最简单的方式是安装Docker Desktop(包含Docker Engine + Compose):
docker compose- Windows:Docker Desktop for Windows(支持WSL 2或Hyper-V)
- Mac:Docker Desktop for Mac(支持Apple Silicon或Intel芯片)
- Linux:Docker Desktop for Linux 或从Docker仓库安装Docker Engine + Compose插件
验证安装:
docker compose versionCheat Sheet & Best Practices
速查表与最佳实践
Commands: / ; / ; ; ; — validate.
docker compose up -ddowndocker compose pslogs -f <service>docker compose exec <service> shdocker compose build --no-cachedocker compose -f compose.prod.yaml configYAML: Use named volumes for DBs (). Use healthchecks ( with , , , ). One network default; reference services by name (e.g. ). Use or ; keep secrets in .
postgres_data:/var/lib/postgresql/datahealthcheck:testintervaltimeoutretrieshttp://api:3000env_fileenvironmentsecrets:Hacks: merges files (later overrides). Use for isolation. Prefer for dev; pin image tags in prod. Run before to catch errors.
-f compose.yaml -f override.yaml--project-namebuild: context: . dockerfile: Dockerfiledocker compose configup常用命令: / ; / ;;; —— 验证配置。
docker compose up -ddowndocker compose pslogs -f <service>docker compose exec <service> shdocker compose build --no-cachedocker compose -f compose.prod.yaml configYAML配置:为数据库使用命名卷(如)。配置健康检查( 包含、、、参数)。默认使用单个网络;通过服务名称访问(例如)。使用或配置环境变量;敏感信息存入。
postgres_data:/var/lib/postgresql/datahealthcheck:testintervaltimeoutretrieshttp://api:3000env_fileenvironmentsecrets:实用技巧: 合并配置文件(后者覆盖前者)。使用实现环境隔离。开发环境优先使用;生产环境固定镜像标签。启动前运行排查错误。
-f compose.yaml -f override.yaml--project-namebuild: context: . dockerfile: Dockerfiledocker compose configCertifications & Training
认证与培训
Docker Certified Associate (DCA): Orchestration 25%, Image/Registry 20%, Install/Config 15%, Networking 15%, Security 15%, Storage 10%. Free: Official DCA Study Guide, Coursera DCA Prep (audit). Skill data: Compose YAML (services, volumes, networks, healthchecks), CLI (up/down/ps/logs/exec).
Docker认证助理(DCA):编排占25%,镜像/仓库占20%,安装/配置占15%,网络占15%,安全占15%,存储占10%。免费资源:官方DCA学习指南,Coursera DCA备考课程(可旁听)。技能覆盖内容:Compose YAML(服务、卷、网络、健康检查),CLI命令(up/down/ps/logs/exec)。
Hooks & Workflows
钩子与工作流
Suggested hooks: Pre-up: (validate). Post-down: optional cleanup. Use when devops or devops-troubleshooter is routed.
docker compose configWorkflows: Use with devops (primary), devops-troubleshooter (primary). Flow: validate compose → up/down/exec per task. See for container debugging.
operations/incident-response推荐钩子:启动前:(验证配置)。停止后:可选清理操作。当路由到devops或devops-troubleshooter时触发。
docker compose config工作流:与devops(主要)、devops-troubleshooter(主要)配合使用。流程:验证compose配置 → 根据任务执行up/down/exec操作。容器调试可参考。
operations/incident-responseOverview
概述
This skill provides comprehensive Docker Compose management, enabling AI agents to orchestrate multi-container applications, manage services, inspect logs, and troubleshoot containerized environments with progressive disclosure for optimal context usage.
Context Savings: ~92% reduction
- MCP Mode: ~25,000 tokens always loaded (multiple tools + schemas)
- Skill Mode: ~700 tokens metadata + on-demand loading
本技能提供全面的Docker Compose管理能力,支持AI Agent编排多容器应用、管理服务、查看日志,并通过渐进式信息披露优化上下文使用,排查容器化环境问题。
上下文节省:约92%的缩减
- MCP模式:始终加载约25,000个token(包含多个工具+ schema)
- 技能模式:仅加载约700个token的元数据+按需加载内容
When to Use
适用场景
- Managing local development environments
- Orchestrating multi-container applications
- Debugging service connectivity and networking
- Monitoring container logs and health
- Building and updating service images
- Testing containerized application stacks
- Troubleshooting service failures
- Managing application lifecycle (start, stop, restart)
- 管理本地开发环境
- 编排多容器应用
- 排查服务连通性与网络问题
- 监控容器日志与健康状态
- 构建与更新服务镜像
- 测试容器化应用栈
- 排查服务故障
- 管理应用生命周期(启动、停止、重启)
Requirements
前置要求
- Docker Engine installed and running
- Docker Compose V2 (plugin — V1
docker composeis end-of-life)docker-compose - Valid (preferred) or
compose.yaml/compose.ymlin projectdocker-compose.yml - Appropriate permissions for Docker socket access
- Docker Engine已安装并运行
- Docker Compose V2(插件 —— V1
docker compose已停止维护)docker-compose - 项目中存在有效的(推荐)或
compose.yaml/compose.yml文件docker-compose.yml - 具备Docker套接字访问权限
Quick Reference
快速参考
bash
undefinedbash
undefinedList running services
列出运行中的服务
docker compose ps
docker compose ps
View service logs
查看服务日志
docker compose logs <service>
docker compose logs <service>
Start services
启动服务
docker compose up -d
docker compose up -d
Stop services
停止服务
docker compose down
docker compose down
Rebuild services
重新构建服务
docker compose build
docker compose build
Execute command in container
在容器中执行命令
docker compose exec <service> <command>
docker compose exec <service> <command>
Live development reloading (Compose Watch)
本地开发热重载(Compose Watch)
docker compose watch
docker compose watch
Start with a profile active
激活指定配置文件启动
docker compose --profile debug up -d
docker compose --profile debug up -d
Validate merged config
验证合并后的配置
docker compose config
undefineddocker compose config
undefined2026 Feature Highlights
2026年功能亮点
compose.yaml — Canonical Filename
compose.yaml — 标准文件名
Docker Compose V2 prefers (and ) over the legacy .
The top-level field is deprecated and should be omitted entirely in new files.
compose.yamlcompose.ymldocker-compose.ymlversion:yaml
undefinedDocker Compose V2优先使用(和),而非旧版的。顶层字段已弃用,新文件中应完全省略。
compose.yamlcompose.ymldocker-compose.ymlversion:yaml
undefinedcompose.yaml (preferred — no version: field needed)
compose.yaml (推荐格式 —— 无需version:字段)
services:
web:
build: .
ports:
- '8080:80'
db:
image: postgres:16-alpine
environment:
POSTGRES_PASSWORD: example
volumes:
- postgres_data:/var/lib/postgresql/data
volumes:
postgres_data:
undefinedservices:
web:
build: .
ports:
- '8080:80'
db:
image: postgres:16-alpine
environment:
POSTGRES_PASSWORD: example
volumes:
- postgres_data:/var/lib/postgresql/data
volumes:
postgres_data:
undefinedCompose Watch — Live Development Reloading
Compose Watch — 本地开发热重载
Compose Watch (GA as of Compose 2.22+) replaces the manual rebuild-restart cycle during development. Configure a block per service. Three actions are available:
develop.watch| Action | Behavior |
|---|---|
| Instantly copies changed files into the running container |
| Triggers |
| Syncs files then restarts the container process (no full rebuild) |
yaml
services:
api:
build: .
ports:
- '3000:3000'
develop:
watch:
# Sync source instantly — no rebuild needed for interpreted code
- action: sync
path: ./src
target: /app/src
ignore:
- node_modules/
# Rebuild when dependency manifest changes
- action: rebuild
path: package.json
# Restart only when config changes
- action: sync+restart
path: ./config
target: /app/configStart with:
bash
undefinedCompose Watch(自Compose 2.22+起正式发布)替代了开发过程中手动重建-重启的循环。可在每个服务下配置块,支持三种操作:
develop.watch| 操作 | 行为描述 |
|---|---|
| 即时将变更文件复制到运行中的容器内 |
| 触发 |
| 同步文件后重启容器进程(无需完整重建) |
yaml
services:
api:
build: .
ports:
- '3000:3000'
develop:
watch:
# 即时同步源码 —— 解释型代码无需重建
- action: sync
path: ./src
target: /app/src
ignore:
- node_modules/
# 依赖清单变更时触发重建
- action: rebuild
path: package.json
# 配置变更时仅重启
- action: sync+restart
path: ./config
target: /app/config启动命令:
bash
undefinedWatch mode (keeps output in foreground)
监听模式(保持前台输出)
docker compose watch
docker compose watch
Or combined with up
或与up命令结合使用
docker compose up --watch
**When to use each action:**
- `sync` — interpreted languages (Node.js, Python, Ruby) where the runtime picks up changes
- `sync+restart` — config or template files that require a process restart but not a full rebuild
- `rebuild` — dependency manifest changes (`package.json`, `requirements.txt`, `go.mod`)docker compose up --watch
**各操作适用场景**:
- `sync` —— 解释型语言(Node.js、Python、Ruby),运行时可自动识别变更
- `sync+restart` —— 配置或模板文件变更,需重启进程但无需完整重建
- `rebuild` —— 依赖清单变更(`package.json`、`requirements.txt`、`go.mod`)Profiles — Environment-Specific Services
配置文件(Profiles)—— 环境专属服务
Profiles allow a single to serve multiple environments. Services without a profile always start. Services with profiles only start when that profile is activated.
compose.yamlyaml
services:
# Always starts — no profile
api:
build: .
ports:
- '3000:3000'
depends_on:
db:
condition: service_healthy
db:
image: postgres:16-alpine
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U postgres']
interval: 5s
timeout: 3s
retries: 5
volumes:
- db_data:/var/lib/postgresql/data
# Only with --profile debug
pgadmin:
image: dpage/pgadmin4:latest
profiles: ['debug']
ports:
- '5050:80'
environment:
PGADMIN_DEFAULT_EMAIL: admin@admin.com
PGADMIN_DEFAULT_PASSWORD: admin
# Only with --profile monitoring
prometheus:
image: prom/prometheus:latest
profiles: ['monitoring']
ports:
- '9090:9090'
grafana:
image: grafana/grafana:latest
profiles: ['monitoring']
ports:
- '3001:3000'
volumes:
db_data:bash
undefined配置文件允许单个适配多环境。无配置文件的服务始终启动,带配置文件的服务仅在激活对应配置文件时启动。
compose.yamlyaml
services:
# 始终启动 —— 无配置文件
api:
build: .
ports:
- '3000:3000'
depends_on:
db:
condition: service_healthy
db:
image: postgres:16-alpine
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U postgres']
interval: 5s
timeout: 3s
retries: 5
volumes:
- db_data:/var/lib/postgresql/data
# 仅在--profile debug时启动
pgadmin:
image: dpage/pgadmin4:latest
profiles: ['debug']
ports:
- '5050:80'
environment:
PGADMIN_DEFAULT_EMAIL: admin@admin.com
PGADMIN_DEFAULT_PASSWORD: admin
# 仅在--profile monitoring时启动
prometheus:
image: prom/prometheus:latest
profiles: ['monitoring']
ports:
- '9090:9090'
grafana:
image: grafana/grafana:latest
profiles: ['monitoring']
ports:
- '3001:3000'
volumes:
db_data:bash
undefinedDefault: api + db only
默认:仅启动api + db
docker compose up -d
docker compose up -d
Debug: api + db + pgadmin
调试模式:启动api + db + pgadmin
docker compose --profile debug up -d
docker compose --profile debug up -d
Monitoring: api + db + prometheus + grafana
监控模式:启动api + db + prometheus + grafana
docker compose --profile monitoring up -d
docker compose --profile monitoring up -d
Multiple profiles
激活多个配置文件
docker compose --profile debug --profile monitoring up -d
docker compose --profile debug --profile monitoring up -d
Via environment variable
通过环境变量激活
COMPOSE_PROFILES=debug,monitoring docker compose up -d
**Profile naming rules:** `[a-zA-Z0-9][a-zA-Z0-9_.-]+` — lowercase kebab-case recommended.COMPOSE_PROFILES=debug,monitoring docker compose up -d
**配置文件命名规则**:`[a-zA-Z0-9][a-zA-Z0-9_.-]+` —— 推荐使用小写短横线分隔格式。Include — Composable Configs
Include — 可组合的配置
The top-level key (introduced in Compose 2.20) allows you to split large compose files into modular, team-owned pieces. Each included file is loaded with its own project directory context, resolving relative paths correctly.
includeyaml
undefined顶层键(Compose 2.20+引入)允许将大型compose文件拆分为模块化、团队专属的片段。每个被包含的文件将加载自身的项目目录上下文,正确解析相对路径。
includeyaml
undefinedcompose.yaml (root — application layer)
compose.yaml(根目录 —— 应用层)
include:
- ./infra/compose.yaml # DB, Redis, message broker
- ./monitoring/compose.yaml # Prometheus, Grafana
services:
api:
build: .
depends_on:
- db # defined in infra/compose.yaml
- redis # defined in infra/compose.yaml
```yamlinclude:
- ./infra/compose.yaml # 数据库、Redis、消息队列
- ./monitoring/compose.yaml # Prometheus、Grafana
services:
api:
build: .
depends_on:
- db # 定义在infra/compose.yaml中
- redis # 定义在infra/compose.yaml中
```yamlinfra/compose.yaml (infrastructure layer — owned by platform team)
infra/compose.yaml(基础设施层 —— 由平台团队维护)
services:
db:
image: postgres:16-alpine
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U postgres']
interval: 5s
timeout: 3s
retries: 5
volumes:
- db_data:/var/lib/postgresql/data
redis:
image: redis:7-alpine
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 5s
timeout: 3s
retries: 5
volumes:
db_data:
`include` is recursive — included files can themselves include other files. Conflicts between resource names cause an error (no silent merging).services:
db:
image: postgres:16-alpine
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U postgres']
interval: 5s
timeout: 3s
retries: 5
volumes:
- db_data:/var/lib/postgresql/data
redis:
image: redis:7-alpine
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 5s
timeout: 3s
retries: 5
volumes:
db_data:
`include`支持递归 —— 被包含的文件可继续包含其他文件。资源名称冲突会触发错误(不会静默合并)。Healthcheck Best Practices
健康检查最佳实践
Always define healthchecks on stateful services so that works correctly. Without healthchecks, dependent services may start before their dependency is ready.
depends_on: condition: service_healthyyaml
services:
db:
image: postgres:16-alpine
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U ${POSTGRES_USER:-postgres}']
interval: 10s # How often to check
timeout: 5s # Time to wait for response
retries: 5 # Failures before marking unhealthy
start_period: 30s # Grace period during container startup
redis:
image: redis:7-alpine
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 10s
timeout: 3s
retries: 3
api:
build: .
depends_on:
db:
condition: service_healthy # waits until db passes healthcheck
redis:
condition: service_healthyHealthcheck guidelines:
- Use (array form) not
CMD(string form) where possible — avoids shell injection riskCMD-SHELL - Use only when you need shell features (
CMD-SHELL,pg_isready, etc.)curl -f - Set for services with slow startup (JVM apps, first-run migrations)
start_period - Avoid in Alpine-based images unless explicitly installed; prefer
curlor native checkswget -q --spider - For HTTP services:
test: ["CMD-SHELL", "wget -q --spider http://localhost:3000/health || exit 1"]
始终为有状态服务定义健康检查,确保正常工作。若无健康检查,依赖服务可能在其依赖项就绪前启动。
depends_on: condition: service_healthyyaml
services:
db:
image: postgres:16-alpine
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U ${POSTGRES_USER:-postgres}']
interval: 10s # 检查间隔
timeout: 5s # 响应超时时间
retries: 5 # 标记为不健康前的重试次数
start_period: 30s # 容器启动后的宽限期
redis:
image: redis:7-alpine
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 10s
timeout: 3s
retries: 3
api:
build: .
depends_on:
db:
condition: service_healthy # 等待db通过健康检查
redis:
condition: service_healthy健康检查指南:
- 尽可能使用(数组形式)而非
CMD(字符串形式)—— 避免Shell注入风险CMD-SHELL - 仅在需要Shell功能(如、
pg_isready等)时使用curl -fCMD-SHELL - 为启动缓慢的服务(JVM应用、首次运行迁移)设置
start_period - Alpine镜像中使用需先安装;优先使用
curl或原生检查wget -q --spider - HTTP服务:
test: ["CMD-SHELL", "wget -q --spider http://localhost:3000/health || exit 1"]
Multi-Stage Build Pattern
多阶段构建模式
Use multi-stage Dockerfiles to keep production images minimal and secure. Reference the specific build stage in compose.yaml for development.
dockerfile
undefined使用多阶段Dockerfile缩小生产镜像体积并提升安全性。在compose.yaml中指定特定构建阶段用于开发。
dockerfile
undefinedDockerfile
Dockerfile
Stage 1: deps — install dependencies
阶段1:deps —— 安装依赖
FROM node:20-alpine AS deps
WORKDIR /app
COPY package*.json ./
RUN npm ci
FROM node:20-alpine AS deps
WORKDIR /app
COPY package*.json ./
RUN npm ci
Stage 2: builder — compile/transpile
阶段2:builder —— 编译/转译
FROM deps AS builder
COPY . .
RUN npm run build
FROM deps AS builder
COPY . .
RUN npm run build
Stage 3: runner — minimal production image
阶段3:runner —— 最小化生产镜像
FROM node:20-alpine AS runner
RUN addgroup -g 1001 -S appgroup && adduser -S -u 1001 -G appgroup appuser
WORKDIR /app
COPY --from=builder --chown=appuser:appgroup /app/dist ./dist
COPY --from=deps --chown=appuser:appgroup /app/node_modules ./node_modules
USER appuser
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=5s --retries=3
CMD wget -q --spider http://localhost:3000/health || exit 1 CMD ["node", "dist/index.js"]
CMD wget -q --spider http://localhost:3000/health || exit 1 CMD ["node", "dist/index.js"]
```yamlFROM node:20-alpine AS runner
RUN addgroup -g 1001 -S appgroup && adduser -S -u 1001 -G appgroup appuser
WORKDIR /app
COPY --from=builder --chown=appuser:appgroup /app/dist ./dist
COPY --from=deps --chown=appuser:appgroup /app/node_modules ./node_modules
USER appuser
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD wget -q --spider http://localhost:3000/health || exit 1
CMD ["node", "dist/index.js"]
```yamlcompose.yaml — dev targets the builder stage for faster iteration
compose.yaml —— 开发环境使用builder阶段以加速迭代
services:
api:
build:
context: .
dockerfile: Dockerfile
target: builder # Stop at builder stage in dev (includes devDeps)
develop:
watch:
- action: sync
path: ./src
target: /app/src
ignore:
- node_modules/
- action: rebuild
path: package.json
```yamlservices:
api:
build:
context: .
dockerfile: Dockerfile
target: builder # 开发环境停留在builder阶段(包含开发依赖)
develop:
watch:
- action: sync
path: ./src
target: /app/src
ignore:
- node_modules/
- action: rebuild
path: package.json
```yamlcompose.prod.yaml — production uses the full runner stage
compose.prod.yaml —— 生产环境使用完整的runner阶段
services:
api:
build:
context: .
dockerfile: Dockerfile
target: runner # Minimal, non-root production image
restart: unless-stopped
undefinedservices:
api:
build:
context: .
dockerfile: Dockerfile
target: runner # 最小化、非root权限的生产镜像
restart: unless-stopped
undefinedResource Limits (Best Practice)
资源限制(最佳实践)
Always define resource limits to prevent container resource exhaustion:
yaml
services:
api:
image: myapp:latest
deploy:
resources:
limits:
cpus: '1.0'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M
restart: unless-stopped始终定义资源限制,防止容器资源耗尽:
yaml
services:
api:
image: myapp:latest
deploy:
resources:
limits:
cpus: '1.0'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M
restart: unless-stoppedTools
工具集
The skill provides 15 tools across service management, monitoring, build operations, and troubleshooting categories:
本技能提供15个工具,涵盖服务管理、监控、构建操作与故障排查四大类别:
Service Management (5 tools)
服务管理(5个工具)
up
up
Start services defined in compose.yaml.
| Parameter | Type | Description | Default |
|---|---|---|---|
| boolean | Run in detached mode | true |
| boolean | Build images before starting | false |
| boolean | Recreate containers | false |
| string | Project name override | directory name |
| array | Specific services to start | all services |
| array | Profiles to activate | none |
| boolean | Enable Compose Watch mode | false |
Example:
bash
docker compose up -d
docker compose up --build
docker compose up web api
docker compose --profile debug up -d
docker compose up --watchSafety: Requires confirmation for production environments.
启动compose.yaml中定义的服务。
| 参数 | 类型 | 描述 | 默认值 |
|---|---|---|---|
| boolean | 后台运行模式 | true |
| boolean | 启动前构建镜像 | false |
| boolean | 强制重新创建容器 | false |
| string | 覆盖项目名称 | 目录名称 |
| array | 指定要启动的服务 | 所有服务 |
| array | 要激活的配置文件 | 无 |
| boolean | 启用Compose Watch模式 | false |
示例:
bash
docker compose up -d
docker compose up --build
docker compose up web api
docker compose --profile debug up -d
docker compose up --watch安全提示:生产环境需要确认。
down
down
Stop and remove containers, networks, volumes.
| Parameter | Type | Description | Default |
|---|---|---|---|
| boolean | Remove volumes (BLOCKED) | false |
| boolean | Remove orphaned containers | false |
| string | Project name override | directory name |
Example:
bash
docker compose down
docker compose down --remove-orphansSafety: Volume removal ( flag) is BLOCKED by default. Requires confirmation.
-v停止并移除容器、网络、卷。
| 参数 | 类型 | 描述 | 默认值 |
|---|---|---|---|
| boolean | 移除卷(已禁用) | false |
| boolean | 移除孤立容器 | false |
| string | 覆盖项目名称 | 目录名称 |
示例:
bash
docker compose down
docker compose down --remove-orphans安全提示:卷移除(参数)默认禁用,需手动确认。
-vstart
start
Start existing containers without recreating them.
| Parameter | Type | Description | Default |
|---|---|---|---|
| array | Specific services to start | all services |
| string | Project name override | directory name |
Example:
bash
docker compose start
docker compose start web启动现有容器(不重新创建)。
| 参数 | 类型 | 描述 | 默认值 |
|---|---|---|---|
| array | 指定要启动的服务 | 所有服务 |
| string | 覆盖项目名称 | 目录名称 |
示例:
bash
docker compose start
docker compose start webstop
stop
Stop running containers without removing them.
| Parameter | Type | Description | Default |
|---|---|---|---|
| number | Shutdown timeout (seconds) | 10 |
| array | Specific services to stop | all services |
| string | Project name override | directory name |
Example:
bash
docker compose stop
docker compose stop --timeout 30 web停止运行中的容器(不移除)。
| 参数 | 类型 | 描述 | 默认值 |
|---|---|---|---|
| number | 关闭超时时间(秒) | 10 |
| array | 指定要停止的服务 | 所有服务 |
| string | 覆盖项目名称 | 目录名称 |
示例:
bash
docker compose stop
docker compose stop --timeout 30 webrestart
restart
Restart services (stop + start).
| Parameter | Type | Description | Default |
|---|---|---|---|
| number | Shutdown timeout (seconds) | 10 |
| array | Specific services to restart | all services |
| string | Project name override | directory name |
Example:
bash
docker compose restart
docker compose restart api重启服务(停止+启动)。
| 参数 | 类型 | 描述 | 默认值 |
|---|---|---|---|
| number | 关闭超时时间(秒) | 10 |
| array | 指定要重启的服务 | 所有服务 |
| string | 覆盖项目名称 | 目录名称 |
示例:
bash
docker compose restart
docker compose restart apiStatus & Logs (3 tools)
状态与日志(3个工具)
ps
ps
List containers with status information.
| Parameter | Type | Description | Default |
|---|---|---|---|
| boolean | Show all containers (including stopped) | false |
| array | Filter by services | all services |
| string | Project name override | directory name |
Example:
bash
docker compose ps
docker compose ps --allOutput Fields: NAME, IMAGE, STATUS, PORTS
列出容器及其状态信息。
| 参数 | 类型 | 描述 | 默认值 |
|---|---|---|---|
| boolean | 显示所有容器(包含已停止) | false |
| array | 按服务筛选 | 所有服务 |
| string | 覆盖项目名称 | 目录名称 |
示例:
bash
docker compose ps
docker compose ps --all输出字段:NAME、IMAGE、STATUS、PORTS
logs
logs
View service logs with streaming support.
| Parameter | Type | Description | Default |
|---|---|---|---|
| array | Services to view logs for | all services |
| boolean | Follow log output (stream) | false |
| number | Number of lines to show | 100 |
| boolean | Show timestamps | false |
| string | Show logs since timestamp/duration | none |
| string | Project name override | directory name |
Example:
bash
docker compose logs web
docker compose logs --tail 50 --follow api
docker compose logs --since "2026-01-01T10:00:00"Note: Follow mode automatically terminates after 60 seconds to prevent indefinite streaming.
查看服务日志,支持流式输出。
| 参数 | 类型 | 描述 | 默认值 |
|---|---|---|---|
| array | 要查看日志的服务 | 所有服务 |
| boolean | 跟踪日志输出(流式) | false |
| number | 显示的日志行数 | 100 |
| boolean | 显示时间戳 | false |
| string | 显示指定时间点/时间段后的日志 | 无 |
| string | 覆盖项目名称 | 目录名称 |
示例:
bash
docker compose logs web
docker compose logs --tail 50 --follow api
docker compose logs --since "2026-01-01T10:00:00"注意:跟踪模式会在60秒后自动终止,防止无限流式输出。
top
top
Display running processes in containers.
| Parameter | Type | Description | Default |
|---|---|---|---|
| array | Services to inspect | all services |
| string | Project name override | directory name |
Example:
bash
docker compose top
docker compose top webOutput: Process list with PID, USER, TIME, COMMAND
显示容器中运行的进程。
| 参数 | 类型 | 描述 | 默认值 |
|---|---|---|---|
| array | 要检查的服务 | 所有服务 |
| string | 覆盖项目名称 | 目录名称 |
示例:
bash
docker compose top
docker compose top web输出:进程列表,包含PID、USER、TIME、COMMAND
Build & Images (3 tools)
构建与镜像(3个工具)
build
build
Build or rebuild service images.
| Parameter | Type | Description | Default |
|---|---|---|---|
| boolean | Build without cache | false |
| boolean | Pull newer image versions | false |
| boolean | Build in parallel | true |
| array | Services to build | all services |
| string | Project name override | directory name |
Example:
bash
docker compose build
docker compose build --no-cache web
docker compose build --pullSafety: Requires confirmation for no-cache builds (resource-intensive).
构建或重新构建服务镜像。
| 参数 | 类型 | 描述 | 默认值 |
|---|---|---|---|
| boolean | 不使用缓存构建 | false |
| boolean | 拉取更新的镜像版本 | false |
| boolean | 并行构建 | true |
| array | 要构建的服务 | 所有服务 |
| string | 覆盖项目名称 | 目录名称 |
示例:
bash
docker compose build
docker compose build --no-cache web
docker compose build --pull安全提示:无缓存构建(资源密集型)需要确认。
pull
pull
Pull service images from registry.
| Parameter | Type | Description | Default |
|---|---|---|---|
| boolean | Continue if pull fails | false |
| array | Services to pull | all services |
| string | Project name override | directory name |
Example:
bash
docker compose pull
docker compose pull web apiSafety: Requires confirmation for production environments.
从注册表拉取服务镜像。
| 参数 | 类型 | 描述 | 默认值 |
|---|---|---|---|
| boolean | 拉取失败时继续 | false |
| array | 要拉取的服务 | 所有服务 |
| string | 覆盖项目名称 | 目录名称 |
示例:
bash
docker compose pull
docker compose pull web api安全提示:生产环境需要确认。
images
images
List images used by services.
| Parameter | Type | Description | Default |
|---|---|---|---|
| string | Project name override | directory name |
Example:
bash
docker compose imagesOutput Fields: CONTAINER, REPOSITORY, TAG, IMAGE ID, SIZE
列出服务使用的镜像。
| 参数 | 类型 | 描述 | 默认值 |
|---|---|---|---|
| string | 覆盖项目名称 | 目录名称 |
示例:
bash
docker compose images输出字段:CONTAINER、REPOSITORY、TAG、IMAGE ID、SIZE
Execution (2 tools)
执行操作(2个工具)
exec
exec
Execute a command in a running container.
| Parameter | Type | Description | Required |
|---|---|---|---|
| string | Service name | Yes |
| array | Command to execute | Yes |
| string | User to execute as | container default |
| string | Working directory | container default |
| object | Environment variables | none |
| string | Project name override | directory name |
Example:
bash
docker compose exec web bash
docker compose exec -u root api ls -la /app
docker compose exec db psql -U postgresSafety:
- Destructive commands (,
rm -rf,dd) are BLOCKEDmkfs - Root user execution requires confirmation
- Default timeout: 30 seconds
在运行中的容器内执行命令。
| 参数 | 类型 | 描述 | 必填项 |
|---|---|---|---|
| string | 服务名称 | 是 |
| array | 要执行的命令 | 是 |
| string | 执行命令的用户 | 容器默认用户 |
| string | 工作目录 | 容器默认目录 |
| object | 环境变量 | 无 |
| string | 覆盖项目名称 | 目录名称 |
示例:
bash
docker compose exec web bash
docker compose exec -u root api ls -la /app
docker compose exec db psql -U postgres安全提示:
- 破坏性命令(、
rm -rf、dd)被禁用mkfs - 以root用户执行需要确认
- 默认超时时间:30秒
run
run
Run a one-off command in a new container.
| Parameter | Type | Description | Default |
|---|---|---|---|
| string | Service to run | Required |
| array | Command to execute | service default |
| boolean | Remove container after run | true |
| boolean | Don't start linked services | false |
| string | User to execute as | container default |
| object | Environment variables | none |
| string | Project name override | directory name |
Example:
bash
docker compose run --rm web npm test
docker compose run --no-deps api python manage.py migrateSafety: Requires confirmation for commands that modify data.
在新容器中运行一次性命令。
| 参数 | 类型 | 描述 | 默认值 |
|---|---|---|---|
| string | 要运行的服务 | 必填 |
| array | 要执行的命令 | 服务默认命令 |
| boolean | 运行后移除容器 | true |
| boolean | 不启动关联服务 | false |
| string | 执行命令的用户 | 容器默认用户 |
| object | 环境变量 | 无 |
| string | 覆盖项目名称 | 目录名称 |
示例:
bash
docker compose run --rm web npm test
docker compose run --no-deps api python manage.py migrate安全提示:修改数据的命令需要确认。
Configuration (2 tools)
配置(2个工具)
config
config
Validate and view the Compose file configuration.
| Parameter | Type | Description | Default |
|---|---|---|---|
| boolean | Pin image tags to digests | false |
| boolean | Don't interpolate env vars | false |
| string | Project name override | directory name |
Example:
bash
docker compose config
docker compose config --resolve-image-digestsOutput: Parsed and merged Compose configuration
验证并查看Compose文件配置。
| Parameter | 类型 | 描述 | 默认值 |
|---|---|---|---|
| boolean | 将镜像标签固定为摘要 | false |
| boolean | 不插值环境变量 | false |
| string | 覆盖项目名称 | 目录名称 |
示例:
bash
docker compose config
docker compose config --resolve-image-digests输出:解析并合并后的Compose配置
port
port
Print the public port binding for a service port.
| Parameter | Type | Description | Required |
|---|---|---|---|
| string | Service name | Yes |
| number | Container port | Yes |
| string | Protocol (tcp/udp) | tcp |
| string | Project name override | directory name |
Example:
bash
docker compose port web 80
docker compose port db 5432Output: binding
<host>:<port>打印服务端口的公开绑定。
| 参数 | 类型 | 描述 | 必填项 |
|---|---|---|---|
| string | 服务名称 | 是 |
| number | 容器端口 | 是 |
| string | 协议(tcp/udp) | tcp |
| string | 覆盖项目名称 | 目录名称 |
示例:
bash
docker compose port web 80
docker compose port db 5432输出: 绑定信息
<host>:<port>Common Workflows
常见工作流
Start a Development Environment
启动开发环境
bash
undefinedbash
undefined1. Validate configuration
1. 验证配置
docker compose config
docker compose config
2. Pull latest images
2. 拉取最新镜像
docker compose pull
docker compose pull
3. Build custom images
3. 构建自定义镜像
docker compose build
docker compose build
4. Start services in detached mode
4. 后台启动服务
docker compose up -d
docker compose up -d
5. Check service status
5. 检查服务状态
docker compose ps
docker compose ps
6. View logs
6. 查看日志
docker compose logs --tail 100
undefineddocker compose logs --tail 100
undefinedLive Development with Compose Watch
使用Compose Watch进行本地开发
bash
undefinedbash
undefined1. Ensure develop.watch blocks are configured in compose.yaml
1. 确保compose.yaml中配置了develop.watch块
2. Start with watch mode (foreground, shows sync events)
2. 启动监听模式(前台,显示同步事件)
docker compose watch
docker compose watch
3. Or start detached then watch
3. 或后台启动后再监听
docker compose up -d
docker compose watch --no-up
undefineddocker compose up -d
docker compose watch --no-up
undefinedTroubleshoot a Failing Service
排查故障服务
bash
undefinedbash
undefined1. Check container status
1. 检查容器状态
docker compose ps --all
docker compose ps --all
2. View service logs
2. 查看服务日志
docker compose logs --tail 200 failing-service
docker compose logs --tail 200 failing-service
3. Inspect running processes
3. 检查运行中的进程
docker compose top failing-service
docker compose top failing-service
4. Check configuration
4. 验证配置
docker compose config
docker compose config
5. Restart the service
5. 重启服务
docker compose restart failing-service
docker compose restart failing-service
6. If needed, recreate container
6. 若需要,重新创建容器
docker compose up -d --force-recreate failing-service
undefineddocker compose up -d --force-recreate failing-service
undefinedUpdate Service Images
更新服务镜像
bash
undefinedbash
undefined1. Pull latest images
1. 拉取最新镜像
docker compose pull
docker compose pull
2. Stop services
2. 停止服务
docker compose down
docker compose down
3. Rebuild if using custom Dockerfiles
3. 若使用自定义Dockerfile,重新构建
docker compose build --pull
docker compose build --pull
4. Start with new images
4. 启动新镜像
docker compose up -d
docker compose up -d
5. Verify services
5. 验证服务
docker compose ps
undefineddocker compose ps
undefinedDebug Service Connectivity
排查服务连通性
bash
undefinedbash
undefined1. Check running services
1. 检查运行中的服务
docker compose ps
docker compose ps
2. Inspect port mappings
2. 检查端口映射
docker compose port web 80
docker compose port api 3000
docker compose port web 80
docker compose port api 3000
3. Exec into container
3. 进入容器
docker compose exec web sh
docker compose exec web sh
4. Test connectivity (from inside container)
4. 测试连通性(从容器内部)
docker compose exec web curl api:3000/health
docker compose exec web curl api:3000/health
5. Check logs for errors
5. 查看错误日志
docker compose logs web api
undefineddocker compose logs web api
undefinedClean Up Environment
清理环境
bash
undefinedbash
undefined1. Stop all services
1. 停止所有服务
docker compose down
docker compose down
2. Remove orphaned containers
2. 移除孤立容器
docker compose down --remove-orphans
docker compose down --remove-orphans
3. View images
3. 查看镜像
docker compose images
docker compose images
4. Clean up (manual - volume removal BLOCKED)
4. 清理(手动操作 - 卷移除已禁用)
Volumes require manual cleanup with explicit confirmation
卷清理需要手动确认
undefinedundefinedUse Profiles for Environment-Specific Services
使用配置文件启动环境专属服务
bash
undefinedbash
undefinedDevelopment: default services only
开发环境:仅启动默认服务
docker compose up -d
docker compose up -d
Development + debug tools
开发环境+调试工具
docker compose --profile debug up -d
docker compose --profile debug up -d
Start monitoring stack
启动监控栈
docker compose --profile monitoring up -d
docker compose --profile monitoring up -d
Via env var (useful in CI)
通过环境变量设置(适用于CI)
COMPOSE_PROFILES=monitoring docker compose up -d
COMPOSE_PROFILES=monitoring docker compose up -d
Stop and clean a specific profile
停止并清理特定配置文件的服务
docker compose --profile debug down
undefineddocker compose --profile debug down
undefinedConfiguration
配置
Environment Variables
环境变量
| Variable | Description | Default |
|---|---|---|
| Default project name | directory name |
| Compose file path | |
| Comma-separated active profiles | (none) |
| Path separator for multiple files | |
| Docker daemon socket | |
| HTTP timeout for API calls | 60 |
| Max parallel operations | unlimited |
| 变量名 | 描述 | 默认值 |
|---|---|---|
| 默认项目名称 | 目录名称 |
| Compose文件路径 | |
| 逗号分隔的激活配置文件 | 无 |
| 多文件路径分隔符 | |
| Docker守护进程套接字 | |
| API调用的HTTP超时时间 | 60 |
| 最大并行操作数 | 无限制 |
Setup
安装设置
-
Install Docker Engine:bash
# macOS brew install --cask docker # Linux (Ubuntu/Debian) sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin # Windows # Download Docker Desktop from docker.com -
Verify Docker Compose:bash
# Check Docker version docker --version # Check Compose version (must be V2, e.g. 2.24+) docker compose version -
Create compose.yaml (nofield — V2 does not require it):
version:yamlservices: web: build: . ports: - '8080:80' depends_on: db: condition: service_healthy db: image: postgres:16-alpine environment: POSTGRES_PASSWORD: example healthcheck: test: ['CMD-SHELL', 'pg_isready -U postgres'] interval: 10s timeout: 5s retries: 5 -
Test the skill:bash
docker compose config docker compose ps
-
安装Docker Engine:bash
# macOS brew install --cask docker # Linux(Ubuntu/Debian) sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin # Windows # 从docker.com下载Docker Desktop -
验证Docker Compose:bash
# 检查Docker版本 docker --version # 检查Compose版本(必须是V2,如2.24+) docker compose version -
创建compose.yaml(无需字段 —— V2不要求):
version:yamlservices: web: build: . ports: - '8080:80' depends_on: db: condition: service_healthy db: image: postgres:16-alpine environment: POSTGRES_PASSWORD: example healthcheck: test: ['CMD-SHELL', 'pg_isready -U postgres'] interval: 10s timeout: 5s retries: 5 -
测试技能:bash
docker compose config docker compose ps
Safety Features
安全特性
Blocked Operations
禁用操作
The following operations are BLOCKED by default to prevent accidental data loss:
- Volume removal: (BLOCKED - requires manual confirmation)
docker compose down -v - Full cleanup: (BLOCKED - extremely destructive)
docker compose down -v --rmi all - Destructive exec: ,
rm -rf,dd,mkfsinside containers (BLOCKED)sudo rm - Force removal: (BLOCKED - use stop then rm)
docker compose rm -f
以下操作默认禁用,防止意外数据丢失:
- 卷移除:(禁用 - 需手动确认)
docker compose down -v - 完全清理:(禁用 - 极具破坏性)
docker compose down -v --rmi all - 破坏性exec命令:容器内执行、
rm -rf、dd、mkfs(禁用)sudo rm - 强制移除:(禁用 - 应先stop再rm)
docker compose rm -f
Confirmation Required
需要确认的操作
These operations require explicit confirmation:
- Building with (resource-intensive)
--no-cache - Pulling images in production environments
- Starting services with
--force-recreate - Executing commands as root user
- Running commands that modify databases
- Stopping services with very short timeouts
以下操作需要明确确认:
- 使用构建(资源密集型)
--no-cache - 生产环境拉取镜像
- 使用启动服务
--force-recreate - 以root用户执行命令
- 运行修改数据库的命令
- 使用极短超时时间停止服务
Auto-Terminating Operations
自动终止操作
The following operations auto-terminate to prevent resource issues:
- Log following (): 60-second timeout
--follow - Service execution (): 30-second timeout
exec - One-off commands (): 60-second timeout
run
以下操作会自动终止,防止资源问题:
- 日志跟踪():60秒超时
--follow - 服务执行():30秒超时
exec - 一次性命令():60秒超时
run
Error Handling
错误处理
Common Errors:
| Error | Cause | Fix |
|---|---|---|
| Docker not installed | Install Docker Engine |
| Docker not running | Start Docker service |
| Network cleanup issue | Run |
| Port conflict | Change port mapping or stop conflicting service |
| Missing compose file | Create |
| Image not built | Run |
| Healthcheck failing | Check |
| Missing included file | Verify paths in |
Recovery:
- Validate configuration:
docker compose config - Check Docker status:
docker info - View service logs:
docker compose logs - Force recreate:
docker compose up -d --force-recreate - Clean restart:
docker compose down && docker compose up -d
常见错误:
| 错误信息 | 原因 | 修复方案 |
|---|---|---|
| 未安装Docker | 安装Docker Engine |
| Docker未运行 | 启动Docker服务 |
| 网络清理问题 | 运行 |
| 端口冲突 | 修改端口映射或停止冲突服务 |
| 缺少compose文件 | 创建 |
| 镜像未构建 | 运行 |
| 健康检查失败 | 查看 |
| 缺少被包含的文件 | 验证 |
恢复步骤:
- 验证配置:
docker compose config - 检查Docker状态:
docker info - 查看服务日志:
docker compose logs - 强制重新创建:
docker compose up -d --force-recreate - 完全重启:
docker compose down && docker compose up -d
Integration with Agents
与Agent的集成
This skill integrates with the following agents:
本技能与以下Agent集成:
Primary Agents
主要Agent
- devops: Local development, CI/CD integration, container orchestration
- developer: Application development, testing, debugging
- devops:本地开发、CI/CD集成、容器编排
- developer:应用开发、测试、调试
Secondary Agents
次要Agent
- qa: Integration testing, test environment setup
- incident-responder: Debugging production issues, service recovery
- cloud-integrator: Cloud deployment, migration to Kubernetes
- performance-engineer: Performance testing, resource optimization
- qa:集成测试、测试环境搭建
- incident-responder:生产问题调试、服务恢复
- cloud-integrator:云部署、向Kubernetes迁移
- performance-engineer:性能测试、资源优化
Progressive Disclosure
渐进式信息披露
The skill uses progressive disclosure to minimize context usage:
- Initial Load: Only metadata and tool names (~700 tokens)
- Tool Invocation: Specific tool schema loaded on-demand (~100-150 tokens)
- Result Streaming: Large outputs (logs) streamed incrementally
- Context Cleanup: Old results cleared after use
Context Optimization:
- Use to limit log output
--tail - Use service filters to target specific containers
- Prefer over
psfor active services onlyps --all - Use for time-bounded log queries
--since
本技能使用渐进式信息披露以最小化上下文使用:
- 初始加载:仅加载元数据和工具名称(约700个token)
- 工具调用:按需加载特定工具的schema(约100-150个token)
- 结果流式输出:大型输出(如日志)增量流式返回
- 上下文清理:使用后清除旧结果
上下文优化技巧:
- 使用限制日志输出
--tail - 使用服务筛选器定位特定容器
- 优先使用而非
ps查看活跃服务ps --all - 使用查询指定时间范围内的日志
--since
Troubleshooting
故障排查
Skill Issues
技能相关问题
Docker Compose not found:
bash
undefinedDocker Compose未找到:
bash
undefinedCheck Docker Compose version
检查Docker Compose版本
docker compose version
docker compose version
V1 (docker-compose) is end-of-life — upgrade to V2
V1(docker-compose)已停止维护 —— 升级到V2
Docker Compose V2 is integrated into Docker CLI as a plugin
Docker Compose V2已作为插件集成到Docker CLI中
**Permission denied**:
```bash
**权限拒绝**:
```bashAdd user to docker group (Linux)
将用户加入docker组(Linux)
sudo usermod -aG docker $USER
newgrp docker
sudo usermod -aG docker $USER
newgrp docker
Verify permissions
验证权限
docker ps
**Compose file issues**:
```bashdocker ps
**Compose文件问题**:
```bashValidate syntax
验证语法
docker compose config
docker compose config
Check for errors (quiet mode — exit code only)
检查错误(静默模式 —— 仅返回退出码)
docker compose config -q
docker compose config -q
View resolved configuration
查看解析后的配置
docker compose config --resolve-image-digests
**Network issues**:
```bashdocker compose config --resolve-image-digests
**网络问题**:
```bashList networks
列出网络
docker network ls
docker network ls
Remove unused networks
移除未使用的网络
docker network prune
docker network prune
Recreate services
重新创建服务
docker compose down
docker compose up -d
**Healthcheck failures**:
```bashdocker compose down
docker compose up -d
**健康检查失败**:
```bashInspect healthcheck status
检查健康检查状态
docker inspect <container_id> | grep -A 10 Health
docker inspect <container_id> | grep -A 10 Health
View healthcheck output
查看健康检查输出
docker compose logs <service>
docker compose logs <service>
Manually run the healthcheck command
手动运行健康检查命令
docker compose exec <service> pg_isready -U postgres
**Compose Watch not syncing**:
```bashdocker compose exec <service> pg_isready -U postgres
**Compose Watch不同步**:
```bashVerify develop.watch block is present in compose.yaml
验证compose.yaml中存在develop.watch块
docker compose config | grep -A 20 develop
docker compose config | grep -A 20 develop
Ensure Compose version is 2.22+
确保Compose版本为2.22+
docker compose version
docker compose version
Watch requires build: attribute (not image: only)
Watch功能需要build属性(不能仅使用image:)
undefinedundefinedPerformance Considerations
性能考量
- Build caching: Use layer caching for faster builds; avoid unless necessary
--no-cache - Multi-stage builds: Dramatically reduce production image size (often 80%+)
- Parallel operations: Docker Compose V2 parallelizes by default; use to control
COMPOSE_PARALLEL_LIMIT - Resource limits: Define CPU/memory limits in compose file to prevent resource exhaustion
- Log rotation: Use logging drivers to prevent disk space issues
- Volume cleanup: Regularly clean unused volumes (requires manual confirmation)
- Compose Watch vs bind mounts: Prefer for cross-platform development; bind mounts have I/O performance issues on macOS/Windows
develop.watch
- 构建缓存:使用分层缓存加速构建;除非必要,否则避免
--no-cache - 多阶段构建:大幅减少生产镜像体积(通常减少80%+)
- 并行操作:Docker Compose V2默认并行执行;使用控制
COMPOSE_PARALLEL_LIMIT - 资源限制:在compose文件中定义CPU/内存限制,防止资源耗尽
- 日志轮转:使用日志驱动防止磁盘空间不足
- 卷清理:定期清理未使用的卷(需手动确认)
- Compose Watch vs 绑定挂载:优先使用进行跨平台开发;绑定挂载在macOS/Windows上存在I/O性能问题
develop.watch
Related
相关资源
- Docker Compose Documentation: https://docs.docker.com/compose/
- Compose File Reference: https://docs.docker.com/compose/compose-file/
- Compose Watch Docs: https://docs.docker.com/compose/how-tos/file-watch/
- Compose Profiles Docs: https://docs.docker.com/compose/how-tos/profiles/
- Compose Include Docs: https://docs.docker.com/compose/how-tos/multiple-compose-files/include/
- Docker CLI: https://docs.docker.com/engine/reference/commandline/cli/
- Kubernetes Migration: (Kubernetes orchestration)
.claude/skills/kubernetes-flux/
- Docker Compose官方文档:https://docs.docker.com/compose/
- Compose文件参考:https://docs.docker.com/compose/compose-file/
- Compose Watch文档:https://docs.docker.com/compose/how-tos/file-watch/
- Compose配置文件文档:https://docs.docker.com/compose/how-tos/profiles/
- Compose Include文档:https://docs.docker.com/compose/how-tos/multiple-compose-files/include/
- Docker CLI:https://docs.docker.com/engine/reference/commandline/cli/
- Kubernetes迁移:(Kubernetes编排)
.claude/skills/kubernetes-flux/
Sources
资料来源
Related Skills
相关技能
- - Cloud platforms (AWS, GCP, Azure) and Terraform infrastructure
cloud-devops-expert
- - 云平台(AWS、GCP、Azure)与Terraform基础设施
cloud-devops-expert
Memory Protocol (MANDATORY)
内存协议(强制)
Before starting:
Read
.claude/context/memory/learnings.mdAfter completing:
- New pattern ->
.claude/context/memory/learnings.md - Issue found ->
.claude/context/memory/issues.md - Decision made ->
.claude/context/memory/decisions.md
ASSUME INTERRUPTION: If it's not in memory, it didn't happen.
开始前:
阅读
.claude/context/memory/learnings.md完成后:
- 新模式 ->
.claude/context/memory/learnings.md - 发现的问题 ->
.claude/context/memory/issues.md - 做出的决策 ->
.claude/context/memory/decisions.md
假设会被中断:未存入内存的内容视为未发生。",