Docker Community Forums

Share and learn in the Docker community.

Usernsremap causing permissions issues

Just started using userns remapping (default) and cannot get host volumes mapped into the container. Keeps giving a permission denied:

ERROR: for vote  oci runtime error: rootfs_linux.go:53: mounting "/app" to rootfs "/var/lib/docker/165536.165536/aufs/mnt/bc58b54f5b592fcc11b436c229f242617d891e873c4b7c97bdc80284c6beb349" caused "stat /home/john/workspace/example-voting-app/vote: permission denied"

I have chown ed vote/ to be owned by 165536 and still no joy.

Am I missing something obvious?

Did you find the solution for that? I’m also facing this problem.

How would you expect this to work here? The container can’t “see” the users from the host, so the user who owns that directory on the host does not exist as far as the container is concerned. Isn’t that what you signed up for using a user namespace? The namespaces are separate.

Presumably you turned on user namespaces because you don’t want containers to have full root privileges on the host filesystem. So why try to violate that separation of concerns by bind mounting in a directory from the host?