Add device cgroup rules

Add device cgroup rules
This commit is contained in:
Kroese 2023-05-25 23:25:17 +02:00 committed by GitHub
commit 9dc85f0951
2 changed files with 4 additions and 0 deletions

View file

@ -11,6 +11,8 @@ services:
devices:
- /dev/kvm
- /dev/vhost-net
device_cgroup_rules:
- 'c *:* rwm'
cap_add:
- NET_ADMIN
ports:

View file

@ -163,6 +163,8 @@ docker run -it --rm -e "BOOT=http://www.example.com/image.iso" --device=/dev/kvm
- 'c *:* rwm'
```
Please note that even if you don't need DHCP, it's still recommended to enable this feature as it prevents NAT issues and increases performance by using a `macvtap` interface.
[build_url]: https://github.com/qemu-tools/qemu-docker/
[ghcr_url]: https://github.com/orgs/qemu-tools/packages/container/package/qemu-docker