Docker tasks: --docker-runtime option (runsc support, default off)

DockerExecutor gains a runtime parameter (passed as docker --runtime
in build_run_command, after --pids-limit); worker CLI gains
--docker-runtime, wired through _build_cli_executor. Unset or empty
means no --runtime flag, so existing tasks keep docker default (runc);
an unregistered runtime fails container start (fail closed), it never
silently falls back. Tests: runsc appears in the command, default/empty
omit it, CLI wiring passes through. README documents the flag and
corrects a stale multi-tenant note (host kernel does not ban userns;
bwrap fails inside Docker containers on nested-pidns proc mount).
This commit is contained in:
host committed 2026-10-26 10:26:21 +08:00
1 parent b31e9365de
commit 9f05178f2b
4 files changed
+93 -5

No files matched your search

+6 -2
View File
@@ -489,14 +489,18 @@ interrupted 且终态任务 cancel 返回 400、心跳后 sweep 不扫刚心跳
`--cap-drop=ALL --security-opt=no-new-privileges`。codex-home
只播种模板的 config.toml(relay 端点与 provider 名,不含
密钥值),绝不复制 thread_history。注意:内层 codex 沙箱仍
是 danger-full-access(主机内核禁 user namespace,bwrap 不可
用),隔离边界是容器 + 挂载 + 网络三层,不是内层沙箱。
是 danger-full-access(bwrap 在 Docker 容器内不可用:嵌套
pidns 下 fresh proc mount 内核 EPERM,宿主级则可用,见下),
隔离边界是容器 + 挂载 + 网络三层,不是内层沙箱。
- 外层加固(内层保持 danger-full-access 时的补偿层):
`--docker-security-opt`(可重复,如 `apparmor=docker-codex`,
见 `deploy/apparmor/docker-codex`:在 Docker 默认 profile
基础上禁 raw 网络、ptrace、mount 与危险 capability;注意
它不含 `userns`,即不启用 bwrap 内层沙箱路线);
`--docker-pids-limit`(默认 512,防 fork 炸弹);
`--docker-runtime`(不传 = docker 默认 runc;传 `runsc` =
任务容器走 gVisor syscall 沙箱,需 daemon 已注册该 runtime,
否则起容器失败;生产切换前须经一次性 worker 模型任务验证);
`--egress-proxy-port`(0 = 不启用;生产配 8888):启用后
Docker 任务容器的 HTTP(S) 出口全部走宿主上的 Tinyproxy
(见 `deploy/egress/`:FilterDefaultDeny 白名单,只放行