Commit 38469d2
committed
Enable FUSE in local-dev Docker containers
In ContainerClient::createContainer(), set Privileged=true, CapAdd=[SYS_ADMIN],
Devices=[/dev/fuse], and SecurityOpt=[apparmor:unconfined] on the user's app
container. Mirrors what Cloudflare's production container runtime effectively
provides, so Workers that use FUSE (via e.g. the Containers FUSE binding)
work in local dev the way they work in production.
Also adds missing $Json.name annotations to docker_api::DeviceMapping fields
so they serialize as PathOnHost / PathInContainer / CgroupPermissions to
match the Docker API. Before this change no call site populated Devices,
so the missing annotations were latent.
Follows the same pattern as createSidecarContainer(), which already sets
CapAdd=[NET_ADMIN] for its own need at container-client.c++:1958-1960.
End-to-end reproduction (FUSE mount syscall actually succeeding inside the
container) in https://github.com/Ben2W/workerd-fuse-local-repro
Signed-off-by: Ben Werner <bewerner23@gmail.com>1 parent 22c1ca0 commit 38469d2
2 files changed
Lines changed: 32 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1698 | 1698 | | |
1699 | 1699 | | |
1700 | 1700 | | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
1701 | 1730 | | |
1702 | 1731 | | |
1703 | 1732 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
0 commit comments