AntelopeIO / DUNES

Docker Utilities for Node Execution
Other
26 stars 17 forks source link

Add a memo describes how DUNE works with Docker Desktop to the installation description #56

Closed jolly-fellow closed 1 year ago

jolly-fellow commented 2 years ago

because as I see on practice lack of information about nuances of this work cause to many issues with DUNE, especially with access to shared files.

Text of the memo:

In the old versions of DUNE synchronization of access rights to shared files between of the host and the container was based on a small hack where we create users with the same UID and GID on the host and in the container. Linux doesn't care of user names but only of id numbers so it considers users with the same ids as the same user. This mechanism worked well until namespaces mapping and rootless start were added to Docker. Since that moment these mechanisms interfere with each other and it causes the bugs.

Docker Desktop works with userns-remap turned on only. I found that Docker Desktop doesn't use dockerd daemon at all. I started Docker Desktop and stopped the daemon but DUNE commands still work well. It seems Docker Desktop has builtin daemon which works in parallel with the dockerd daemon. It is very easy to confuse which system you are currently working with. It cause issues and misunderstandings.

Fix https://github.com/AntelopeIO/DUNE/pull/34 removes the hack with creation in the container of a user with the same UID and GID as the host user. It allows Docker with turned on userns-remap correctly map UID and GID of a user from the container to a current host user. So all shared files get the UID and GID of a current host user.

Therefore now for successful work with DUNE you need:

mikelik commented 1 year ago

Looks good. I don't think user needs to know history of the issues so I would shorten the memo to: "Docker Desktop works with userns-remap turned on only. Docker Desktop doesn't use dockerd daemon at all. When Docker Desktop is started and dockerd daemon is stopped then DUNE commands still work well. Docker Desktop has builtin daemon which works in parallel with the dockerd daemon. It is very easy to confuse which system you are currently working with.

Therefore now for successful work with DUNE you need: