jupyter/dockerspawner — pull request #8 by jhamrick (2014-11-18 23:49:49+00:00)
Title: Treat users as system users and mount home directories

This adds a few configuration options to dockerspawner in order to treat users as system users (and therefore also mount their home directories). Importantly, if `system_users` is set to `True` and the `jupyter/systemuser` docker image is used (rather than the `jupyter/singleuser` image), then:

* the user will be created in the running container with user id specified in the dictionary `self.user_ids`
* home directories will be mounted from `self.host_homedir_format_string` on the host to `/home/{username}` in the container
* containers will be named as the specified user

I don't like the way it's currently adding users to the running container, because it requires running the container with the root user, adding the new user, and then sudoing to that user. Perhaps a better solution would be to create a non-root user (e.g. jupyter) when the image is created, and then give them permission to add users, and then have that user add the new user and sudo? But that doesn't really seem all that much better than just doing it with the root user. And, it's inside of the container anyway, so does it even matter all that much?