From 2d6cdeaaf4dc37ff077858de7ab3ba43daee29a2 Mon Sep 17 00:00:00 2001 From: Roman Priesol Date: Sat, 24 Oct 2026 00:54:15 +0200 Subject: [PATCH] compose: shared :z on data mounts so kiwix can read its ZIM maptool's private :Z on ./data recursively relabeled data/kiwix/wikipedia.zim to maptool's own MCS label, locking the kiwix container out of it ("Unable to add the ZIM file"), and kiwix's :Z would do the same back. Both mount the same file, so the label has to be shared. --- docker-compose.yaml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 7596a66..55b72b8 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -65,12 +65,14 @@ services: # happens outside this mount, in the container's own filesystem — a # large country's .osm.pbf plus Planetiler's working set can be # several GB, worth knowing if the host is ever short on space there. - # :Z (not :z — this path is only ever mounted into this one - # container) relabels the host directory for SELinux, since Podman - # on an SELinux-enforcing host otherwise denies the container write - # access to a bind-mounted directory regardless of Unix permissions - # — harmless/ignored on a host without SELinux. - - ./data:/app/data:Z + # :z relabels the host directory for SELinux, since Podman on an + # SELinux-enforcing host otherwise denies the container write access + # to a bind-mounted directory regardless of Unix permissions — + # harmless/ignored on a host without SELinux. Shared :z, not private + # :Z: kiwix below mounts data/kiwix/wikipedia.zim too, and :Z here + # recursively relabels that file to maptool's own private label, + # locking kiwix out of it (and kiwix's :Z would do the same back). + - ./data:/app/data:z # Fakes a GNSS fix (a loop around Bratislava, see # bin/gnss_simulator.rb/docs/development.adoc) since there's no real @@ -123,8 +125,8 @@ services: # ever talks to this container directly. command: ["--urlRootLocation=/kiwix", "/data/wikipedia.zim"] volumes: - # :Z, same SELinux reasoning as maptool's own ./data mount above. - - ./data/kiwix/wikipedia.zim:/data/wikipedia.zim:Z + # :z, shared for the same reason as maptool's own ./data mount above. + - ./data/kiwix/wikipedia.zim:/data/wikipedia.zim:z networks: default: