docs(ops): add Docker+Colima sandbox baseline and resource profiles

This commit is contained in:
Chen Gu
2026-08-13 17:00:21 +08:00
parent cd14a09075
commit 95f2c06955
2 changed files with 103 additions and 0 deletions
+80
View File
@@ -0,0 +1,80 @@
# Sandbox BaselineDocker CLI + Colima
日期:2026-03-10
状态:active
## 1) 当前可用性检查(已通过)
- Docker Client/Server: `29.3.0 / 29.2.1`
- Colima: runningQEMU / x86_64 / runtime=docker
- Docker 引擎信息:
- driver: `overlayfs`
- cgroup: `cgroupfs`
- CPU: `2`
- Memory: `~3.0GB`
- 冒烟测试:`docker run --rm hello-world` 成功
## 2) 基线目标
用于后续 subagent 项目开发、构建、预览与部署演练,确保:
- 环境可复现
- 资源可控
- 日志可追溯
- 故障可回滚
## 3) 资源基线(建议)
- 默认 profile`colima default`
- CPU:2(轻量项目)/ 4(构建型项目)
- Memory3GB(轻量)/ 6GB(中型)
- Disk>= 30GB
> 若项目为前端+SSR或多容器编排,建议先升到 `4C / 6GB`。
## 4) 目录与挂载约定
- Workspace`/Users/guchen/.openclaw/workspace`
- 项目容器挂载统一:`/workspace`
- 项目级缓存:放在项目内 `.cache/`(便于清理)
## 5) 运行约束
- 禁止在沙箱内修改 OpenClaw 主配置
- 生产密钥不得写入镜像层
- 容器默认无特权模式(非必要不加 `--privileged`
## 6) 标准操作
### 启停
```bash
colima start
colima stop
```
### 快速健康检查
```bash
docker version
docker info
docker run --rm hello-world
```
### 项目运行(示例)
```bash
docker run --rm -it \
-v /Users/guchen/.openclaw/workspace:/workspace \
-w /workspace node:20 bash
```
## 7) 故障兜底
- Docker 命令异常:先 `colima status` 确认运行状态
- Socket 异常:重启 Colima
- 镜像/层损坏:
```bash
docker system prune -f
```
## 8) 下一步
- 将 Val Blog 项目接入此基线(docker-compose + 一键预览)
- 增加项目级资源模板(light/medium/high
+23
View File
@@ -0,0 +1,23 @@
{
"version": "v1",
"profiles": {
"light": {
"cpu": 2,
"memoryGb": 3,
"diskGb": 30,
"useCase": "docs/static-site/small tools"
},
"medium": {
"cpu": 4,
"memoryGb": 6,
"diskGb": 50,
"useCase": "frontend+api/multi-container dev"
},
"high": {
"cpu": 6,
"memoryGb": 10,
"diskGb": 80,
"useCase": "build-heavy/parallel test workloads"
}
}
}