Closed tomzo closed 4 years ago
Thanks for opening this issue. Your solution in this commit looks good. I think it would be nice to also add a comment, in that file 50-fix-uid-gid.sh
, explaining why we need to check uid and gid as another user.
We also have to add a test on Mac OSX.
In order to support OSX, for all the public images we will need them to use 0.6.0 version of dojo in the image scripts.
Nice that you have clearly stated that. Have you tested any dojo docker image on Mac? There is kudulab/ansible-dojo:1.1.0
with dojo scripts 0.6.0.
OSX experience is good since Dojo 0.6.0
We should provide the same experience on Mac as on Linux. Currently most of dojo images won't work because of fix-uid-gid scripts trying to work around the mapping. This is caused by osx driver trying to be smart about ownership of the mounted volumes.
osxfs docker driver behaviour
Basically the current user in the container always owns the mounted volume.
This snippet illustrates the problem:
More detailed explanation - https://stackoverflow.com/questions/43097341/docker-on-macosx-does-not-translate-file-ownership-correctly-in-volumes
Current problem
Dojo by design has to ensure that
/home/dojo
and/dojo/work
is owned by the current user. Since/dojo/work
is a mount, on a Mac, this will be owned by current user automagically. So there is only/home/dojo
to take care of. Currently, as part of entrypoint setup, fix-uid-gid scripts (running as root) would read uid/gid of the/dojo/work
(getting 0/0), then create and chown files in/home/dojo
. This results in home files owned by the root.Solutions?
We need a way to handle this, ideally without a big
IF Linux/Mac then
.