mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
pnpm 11 no longer reads npm_config_* env vars, so the guest image pins the store to a container-internal path through PNPM_CONFIG_STORE_DIR; unpinned, pnpm places the store on the bind-mounted project filesystem, polluting the repository. Adds a regression test and bumps the ocm-sandbox digest to the rebuilt image.
32 lines
1.3 KiB
YAML
32 lines
1.3 KiB
YAML
# Agent Sandboxing overlay (microsandbox / msb)
|
|
# Grants the container KVM access and persists microsandbox state so OpenCode
|
|
# agent commands can run inside a microVM. Linux host with /dev/kvm required.
|
|
# Use with: docker compose -f docker-compose.yml -f docker-compose.sandbox.yml up -d
|
|
#
|
|
# This overlay deliberately does NOT use `privileged: true`. It grants only
|
|
# /dev/kvm (microVM execution), /dev/net/tun and NET_ADMIN (guest networking
|
|
# for SANDBOX_NET=public). If msb reports a missing device or capability on a
|
|
# particular host, add that specific entry rather than enabling full privilege.
|
|
|
|
services:
|
|
app:
|
|
devices:
|
|
- "/dev/kvm:/dev/kvm"
|
|
- "/dev/net/tun:/dev/net/tun"
|
|
cap_add:
|
|
- NET_ADMIN
|
|
environment:
|
|
- SANDBOX_IMAGE=${SANDBOX_IMAGE:-docker.io/cstechdev/ocm-sandbox@sha256:edec46ffc48bd23fdd36b732492df7c5da5acd687ba0383e66ee28bc7c78770f}
|
|
- SANDBOX_MEMORY=${SANDBOX_MEMORY:-4G}
|
|
- SANDBOX_CPUS=${SANDBOX_CPUS:-2}
|
|
- SANDBOX_EXEC_USER=${SANDBOX_EXEC_USER:-${PUID:-1000}}
|
|
- SANDBOX_NET=${SANDBOX_NET:-public}
|
|
- SANDBOX_START_TIMEOUT_MS=${SANDBOX_START_TIMEOUT_MS:-300000}
|
|
- SANDBOX_EXEC_TIMEOUT_MS=${SANDBOX_EXEC_TIMEOUT_MS:-600000}
|
|
volumes:
|
|
- microsandbox-data:/home/node/.microsandbox
|
|
|
|
volumes:
|
|
microsandbox-data:
|
|
driver: local
|