Skip to content

Commit 8a5af1f

Browse files
committed
Add comments explaining why privileges are granted individually
1 parent f59688f commit 8a5af1f

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

compose.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ services:
33
build:
44
context: docker
55
dockerfile: Dockerfile
6+
# Instead of privileged: true, grant only the minimum privileges required
7+
# to run BuildKit and iptables. This avoids granting full device access
8+
# and unrestricted /sys write permissions that privileged mode includes.
9+
#
610
# BuildKit OCI worker requires SYS_ADMIN for mount, namespaces, and cgroups.
711
# iptables and CNI networking require NET_ADMIN.
812
# runc needs SYS_PTRACE to access /proc/PID/ns/mnt for mount namespace setup.

setup/compose.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
services:
22
builder:
33
image: ${BUILDCAGE_IMAGE}:${BUILDCAGE_VERSION:-1}
4+
# Instead of privileged: true, grant only the minimum privileges required
5+
# to run BuildKit and iptables. This avoids granting full device access
6+
# and unrestricted /sys write permissions that privileged mode includes.
7+
#
48
# BuildKit OCI worker requires SYS_ADMIN for mount, namespaces, and cgroups.
59
# iptables and CNI networking require NET_ADMIN.
610
# runc needs SYS_PTRACE to access /proc/PID/ns/mnt for mount namespace setup.

0 commit comments

Comments
 (0)