Application writes files as UID 1000 but the mounted host directory is root-owned.
IntermediateScenarioVolumes, storage and data
Answer
Situation read → Permission denied on bind mount caused by UID mismatch.
What I'd do →
chown 1000:1000 /srv/app-dataon the host, or run with--user $(id -u):$(id -g).- With named volumes, Docker copies ownership from the image path on first use, so
chownin the Dockerfile before first mount. - On SELinux hosts add
:zor:Z.
Why → The kernel checks numeric IDs, not names.
Interview tip → With rootless/userns-remap the host UID differs from the container UID.
More on Volumes, storage and data
A Postgres container was removed and the data is gone. How should it have been run?BeginnerBind mount or named volume for local development of a Node app?BeginnerHow do you back up a named volume?IntermediateTwo containers must share files. What are your options?BeginnerA container needs a writable temp area but the root filesystem is read-only.IntermediateMoving a database volume from one Docker host to another.Intermediate