Skip to content

dev: Fix cache directory permissions for nonroot user#131

Merged
lynnagara merged 1 commit into
mainfrom
filesystem-perms
May 19, 2026
Merged

dev: Fix cache directory permissions for nonroot user#131
lynnagara merged 1 commit into
mainfrom
filesystem-perms

Conversation

@lynnagara
Copy link
Copy Markdown
Member

The distroless runtime image runs as nonroot, but /tmp/synapse-cache doesn't exist in the image — so when devservices mounts a named volume there, Docker creates the mountpoint as root and the locator's filesystem backup store fails to write.

Pre-create the directory in the builder stage and COPY it into the runtime image with --chown=nonroot:nonroot, so named volumes inherit nonroot ownership.

Since the path is now baked into the image, make base_dir optional in the locator config (defaulting to /tmp/synapse-cache) and drop the explicit setting from the devservices YAMLs.

The distroless runtime image runs as `nonroot`, but `/tmp/synapse-cache`
doesn't exist in the image — so when devservices mounts a named volume
there, Docker creates the mountpoint as root and the locator's
filesystem backup store fails to write.

Pre-create the directory in the builder stage and COPY it into the
runtime image with `--chown=nonroot:nonroot`, so named volumes inherit
nonroot ownership.

Since the path is now baked into the image, make `base_dir` optional in
the locator config (defaulting to `/tmp/synapse-cache`) and drop the
explicit setting from the devservices YAMLs.
@lynnagara lynnagara requested a review from a team as a code owner May 19, 2026 19:50
@lynnagara lynnagara merged commit bcf0fc7 into main May 19, 2026
20 checks passed
@lynnagara lynnagara deleted the filesystem-perms branch May 19, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants