Why do I get "permission denied" writing to a bind mount?
IntermediateConceptVolumes & Bind Mounts
Answer
UIDs are numeric and not translated by default: a container user with UID 1000 writes to a host directory owned by UID 1001 or root. Fix by matching UID/GID (--user $(id -u):$(id -g)), chown the host dir, or use userns-remap. On SELinux hosts add :z or :Z to relabel; on rootless Podman use :U or --userns=keep-id.
More on Volumes & Bind Mounts
What are the three ways to persist or share data with a container?BeginnerVolume vs bind mount: when do you pick which?BeginnerWhat is the difference between `-v` and `--mount`?BeginnerWhat is an anonymous volume and how do you find leftovers?IntermediateHow does a new named volume get populated?IntermediateHow do you back up and restore a named volume?Intermediate