Files
iAs/docker
wunianxiao cacd4436ce fix(sandbox): builder 容器 --user uid:gid + 离线模式,修 cap-drop 写权限
步骤 9: tool_manager build 迁移到 builder 容器验证通过。

问题: --cap-drop ALL 丢掉 CAP_DAC_OVERRIDE,容器内 root 无法写
      bind mount 的非 root 目录(宿主 xiao:1000)。
      这是 cap-drop 正确生效的安全行为,非 bug。

修复:
- builder 容器 --user uid:gid 以宿主用户身份运行,自然能写自己
  的目录,同时保留 cap-drop ALL + no-new-privileges。
- Cargo.toml 改 CARGO_HOME=/tmp/cargo + chmod 777,使任意 uid
  都能复用 serde_json 预缓存。
- cargo build --offline + CARGO_NET_OFFLINE=true,配合 --network
  none 真正离线编译,杜绝恶意代码下载依赖。

端到端: tool_manager create_tool → builder 容器离线编译 →
产物运行成功,审计日志记录正确。
2026-06-22 11:49:31 +08:00
..