Skip to content

--mount=type=cache permissions issue with non-root users #25260

Answered by nalind
jonner asked this question in Q&A
Discussion options

You must be logged in to vote

A cache directory is reused based on its "id", or "target" if an "id" isn't set, and the ownership on a cache directory is set only when it's created the first time, so even after adding the "uid" option, you'd likely still have been using the same directory that was originally created for the default user "0:0". You should be able to clear it with podman system prune while experimenting, or by using a unique "id" option to force a different cache to be created and used.

It does appear that in docker build, cache directories are isolated by that owner UID as well, which would have prevented this conflict, so we need to fix that.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jonner
Comment options

Answer selected by jonner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants