dev: Fix cache directory permissions for nonroot user#131
Merged
Conversation
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.
markstory
approved these changes
May 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The distroless runtime image runs as
nonroot, but/tmp/synapse-cachedoesn'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_diroptional in the locator config (defaulting to/tmp/synapse-cache) and drop the explicit setting from the devservices YAMLs.