From 844e1acffd83f8e101df1506e9eb49d773234bb4 Mon Sep 17 00:00:00 2001 From: Antonio SJ Musumeci Date: Wed, 25 Nov 2026 12:59:08 -0500 Subject: [PATCH] docs: limit the Compose mount to the permissions mergerfs needs The sample enabled privileged mode in addition to passing /dev/fuse and granting SYS_ADMIN. That exposed unrelated host devices and capabilities to the container. Remove the blanket grant and keep the same device, capability and propagation settings as the rootful CLI example. Docker's default AppArmor profile denies mount(2), so on hosts where AppArmor is enforcing the container also needs apparmor=unconfined or a profile that allows the FUSE mount. Say so rather than restoring privileged mode. --- mkdocs/docs/setup/installation.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mkdocs/docs/setup/installation.md b/mkdocs/docs/setup/installation.md index 4d912d3d..03140505 100644 --- a/mkdocs/docs/setup/installation.md +++ b/mkdocs/docs/setup/installation.md @@ -135,7 +135,7 @@ docker pull ghcr.io/trapexit/mergerfs:TAG docker run --device=/dev/fuse --cap-add=SYS_ADMIN -v /mnt/to-merge:/mnt/to-merge:rshared -v /mnt/mergerfs:/mnt/mergerfs:z,shared ghcr.io/trapexit/mergerfs:TAG -f '/mnt/to-merge/*' '/mnt/mergerfs' ``` - or with docker compose +or with docker compose ``` services: @@ -143,7 +143,6 @@ services: image: ghcr.io/trapexit/mergerfs:TAG container_name: mergerfs restart: unless-stopped - privileged: true cap_add: - SYS_ADMIN devices: @@ -164,6 +163,11 @@ services: relabeling?](../faq/compatibility_and_integration.md#does-mergerfs-work-with-selinux-relabeling) * `-v /mnt/to-merge:/mnt/to-merge:rshared`: The mounts from the host to merge within the container. +* **AppArmor enforcing hosts:** Docker's default container profile + denies `mount(2)`, so `/dev/fuse` plus `SYS_ADMIN` is not enough. + Add `security_opt: ["apparmor=unconfined"]` to the service (or + `--security-opt apparmor=unconfined` with `docker run`) or use a + custom profile that allows the FUSE mount. ### rootless container runtimes