Open matthewolckers opened 4 years ago
geteuid()
is only available on unix like systems. This explains why it doesn't work on Windows. I am not sure if we could easily add an alternative that would work on Windows and leave the current behaviour the same on unix-like systems.
Windows support in repo2docker is "low", mostly because it is hard and because none of the devs have access to a windows machine. If you have some time and spare brain cycles to look into this that would be great.
geteuid()
is used to set the default UID inside the Docker container:
https://github.com/jupyterhub/repo2docker/blob/09a4cfb7cf68fb59175df0c7c3b11dd1e2f4ecb5/repo2docker/app.py#L201-L206
A reasonable workaround for windows could be to detect the OS and return an error message requiring --user-id
to be specified.
As a workaround, WSL2 can be used without problems.
I might try to fix this issue for Windows in general. Are there more known possible solutions besides the one mentioned by @manics ?
AFAIK the only reason to make the UID inside the Docker image match the user's UID is so that if you mount the user's home directory into the container it'll be writeable. Is that possible on Windows and if so, how are UIDs mapped, since that might lead to a good solution?
Doing a cursory search I found something that might be relevant in pip
Reproducing here the beginning of the referenced function
def check_path_owner(path):
# type: (str) -> bool
# If we don't have a way to check the effective uid of this process, then
# we'll just assume that we own the directory.
if sys.platform == "win32" or not hasattr(os, "geteuid"):
return True
Perhaps a similar approach would be sufficient?
I got to move from the original issue by forcing to run with a given GUID in the _user_id_default
method.
@default("user_id")
def _user_id_default(self):
"""
Default user_id to current running user.
"""
if sys.platform == "win32" or not hasattr(os, "geteuid"):
return 1001
return os.geteuid()
With this change, the execution then stops working in step 31 when trying to execute install-miniforge.bash
.
Step 30/50 : USER root
---> Using cache
---> 394ba1fe367c
Step 31/50 : RUN TIMEFORMAT='time: %3R' bash -c 'time /tmp/install-miniforge.bash' && rm /tmp/install-miniforge.bash /tmp/environment.yml
---> Running in cf91e3dafa9a
bash: /tmp/install-miniforge.bash: Permission denied
time: 0.001
My docker
knowledge at this moment doesn't go too deep as to know how to start digging deeper into this error/issue. Anyone here has a hint on how to progress here to diagnose the problem in an effective way?
In other words, repo2docker is useless on Windows. great
Bug description
Expected behaviour
Expect to produce docker image.
Actual behaviour
How to reproduce
Run
repo2docker https://github.com/matthewolckers/fbr2020