Interview Prep/Docker/Volumes, storage and data

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 →

  1. chown 1000:1000 /srv/app-data on the host, or run with --user $(id -u):$(id -g).
  2. With named volumes, Docker copies ownership from the image path on first use, so chown in the Dockerfile before first mount.
  3. On SELinux hosts add :z or :Z.

Why → The kernel checks numeric IDs, not names.

Interview tip → With rootless/userns-remap the host UID differs from the container UID.

All Docker questions Roadmap: Docker & containers

More on Volumes, storage and data