Closed spMohanty closed 5 years ago
I do manage to get it to run by instead passing a custom user-name
and user-id
, but ideally I believe it should work with the default options.
repo2docker --no-run --user-id 1001 --user-name crowdai --debug .
Thanks for this. I think we never considered anyone running repo2docker
as root before.
The relevant bit of config is this bit here. It does the right thing most of the time (use the username of the user running repo2docker) except when you are root (or any other system account that already exists in the image). What do people think of special casing being executed as root
and using jovyan
as the user in the image in that case? An alternative would be to make the adduser
command conditional inside the image.
user-id can be set with repo2docker --user-id=1000 --user-name=12345
. I don't think we should special-case anything based on what the calling user is. Requiring users running as root to specify these arguments, since the image itself shouldn't build as root seems like the right thing to do.
@minrk could we just check for root with os.geteuid
and then raise an informative error if user-id
isn't explicitly set?
@choldgraf good idea. I imagine we can.
If it still matters, just hit this issue in the master
build of repo2docker on Ubuntu 18. Was running jupyter-repo2docker
as sudo to avoid some permissions hassle with Docker.
Maybe the first thing to do here is to make repo2docker
recognise it is being executed as root
and stop with an error message pointing people to the --user-name
and --user-id
options.
I think trying to guess as what users we should be running is pretty hard, better to let the user decide for themselves. For the novice user the advice should probably be "you shouldn't be doing this, do X instead" and for the advanced user pointing them to the CLI options will let them figure out how to get unstuck.
In a fresh installation of
docker-ce
onUbuntu-16.04
, if I try to locally build a binder repository, then I get the following logs (and finally the error):This can be deterministically replicated by :