Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions deploy/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ services:
retries: 30
hub:
<<: *hub
# The coder and designer run their commands under bubblewrap, which gives
# each one its own user, pid and mount namespaces with a fresh /proc.
# Docker's default seccomp profile refuses the namespaces without
# CAP_SYS_ADMIN, its AppArmor profile refuses the mount propagation, and
# its masked /proc paths refuse the fresh /proc, so the hub runs without
# those three and keeps its capabilities dropped. On Ubuntu 24.04 hosts
# the kernel must also allow it; see "Sandboxes" in docs/SELF_HOST.md.
security_opt:
- seccomp=unconfined
- apparmor=unconfined
- systempaths=unconfined
ports:
- "127.0.0.1:${PORT:-8000}:${PORT:-8000}"
- "127.0.0.1:1455:1455"
Expand Down
19 changes: 19 additions & 0 deletions docs/SELF_HOST.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,25 @@ docker compose --env-file .env.hub --project-directory . -f deploy/compose.yml -

`bun run docker:up` runs the same.

## Sandboxes

The coder and designer run every command under bubblewrap, which needs a user
namespace with its capabilities intact, mount propagation and a fresh `/proc`.
The hub service runs with `seccomp=unconfined`, `apparmor=unconfined` and
`systempaths=unconfined` for that; its capabilities stay dropped. Ubuntu 24.04
and later strip the capabilities from unprivileged user namespaces, so on such
a host (including the Ubuntu VM that Colima runs) also turn that restriction
off, and make it persist across reboots:

```sh
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
echo kernel.apparmor_restrict_unprivileged_userns=0 | sudo tee /etc/sysctl.d/60-builder-userns.conf
```

Without it every designer and coder tool call fails with
`sandbox_tool_process_failed: bwrap: No permissions to create a new namespace`
or `bwrap: setting up uid map: Permission denied`.

## Sidecars in Docker

Agents run in sidecars. By default the hub starts them as processes beside
Expand Down