Re:Docker 1.10.0 is out
by the_common_man on Thursday February 04, 2016 @06:32PM
(#11038128)
Yes, I think this will solve it.
In unix, a uid is just an integer (chown <random_int> file will work). In your case, the container created a file in a volume with a uid. This uid makes no sense on host but it leaks out to host anyway since it's a 'volume'.
I think with the userns map, you can map container uid to a host uid. The files created in the volume will then be visible on the host as the mapped uid.
This is my understanding, I have to play with it :-)
Re:Docker 1.10.0 is out
by ThePhysicist on Thursday February 04, 2016 @06:22PM
(#11038078)
I think the canonical way (at least a while ago) was to only manipulate volumes using containers. There might be other solutions available now but this one seems to be the easiest, as it does not require to change the permissions or ownership on the files/volumes being manipulated.
Don't run compass as root.
Don't run anything as root unnecessarily.
(Your problem is likely because you refer to the root namespace as a "host". It is common practice, but leads people to bad conclusions.)
I think I might have caused a misunderstanding of the issue (I was trying to be brief). It really doesn't matter who I'm running compass as (root or otherwise), the issue is that the container is writing files to my host with a different UID:GID then the one I'm using on my host machine.
I wouldn't normally run compass as root, it was incidental to the actual issue.
Use case:
Using compass within a container for development
Compass creates sass files with whatever user it run under within the container (likely root)
Host must chmod them to do stuff with them
As a work around, I've been building images and creating a user:group that matches my host. Obviously this destroys portability for other developers.