I try to create an individual notebook setup for each user.
jupyerhub_config.py
docker_notebook_image = os.environ['DOCKER_NOTEBOOK_IMAGE']
c.DockerSpawner.image = docker_notebook_image
c.DockerSpawner.cmd = ["start.sh"]
c.DockerSpawner.default_url = '/lab'
c.DockerSpawner.notebook_dir = '/home/{username}'
c.DockerSpawner.environments = {
'NB_USER': '{username}',
'CHOWN_HOME': 'yes',
'CHOWN_EXTRA': '/home/{username}',
'CHOWN_EXTRA_OPTS': '-R'
}
Result:
Set username to: {username}
Relocating home dir to /home/{username}
Setting CWD to /home/{username}/
Changing ownership of /home/{username} to 1000:100 with options ''
Executing the command: --ip=0.0.0.0 --port=8888 --notebook-dir=/home/haag --SingleUserNotebookApp.default_url=/lab --debug
When I add
c.DockerSpawner.extra_create_kwargs = { 'user': 'root'}
container fails with:
[I 2021-04-15 14:55:37.507 SingleUserNotebookApp mixins:557] Starting jupyterhub-singleuser server version 1.3.0
[D 2021-04-15 14:55:37.512 SingleUserNotebookApp _version:76] jupyterhub and jupyterhub-singleuser both on version 1.3.0
[C 2021-04-15 14:55:37.512 SingleUserNotebookApp notebookapp:2252] Running as root is not recommended. Use --allow-root to bypass.
[D 2021-04-15 14:55:37.512 SingleUserNotebookApp application:834] Exiting application: jupyter-notebook
What am I doing wrong?