Jupyterhub/singleuser shared volume

I’m trying to setup a Jupyterhub server on Ubuntu 16.04, much along the lines of https://github.com/minrk/jupyterhub-demo.

I changed the jupyterhub_config.py to support persistent storage using the tips given here https://github.com/jupyterhub/dockerspawner#data-persistence-and-dockerspawner:

  • Mariadb-10.0 install fails in boot2docker with “policy-rc.d denied execution” but works in Docker
  • docker push to private registry hangs
  • Docker Alpine nginx 403 Forbidden error for swagger-ui-builder
  • Docker for Mac: Using Persistent Storage
  • Docker swarm - add new worker - re scale the service
  • Docker, how to remote ssh from command line host to a docker container?
  • notebook_dir = os.environ.get('DOCKER_NOTEBOOK_DIR') or '/home/jovyan/work'
    c.DockerSpawner.notebook_dir = notebook_dir
    c.DockerSpawner.volumes = { 'jupyterhub-user-{username}': notebook_dir }
    

    However, I would like to add a shared “team” volume for teams of users. I have a dictionary with usernames (keys) and teamnames (values) to map users to teams.

    Ideally I would state something like:

    c.DockerSpawner.volumes = { 
        'jupyterhub-user-{username}': notebook_dir, 
        'jupyterhub-team-{teamname}': os.path.join(notebook_dir, 'shared' 
    }
    

    But I have no clue as to how to pass another {name} mapping to dockerspawner.

    I tried fiddling with these, but so far to no avail:

    c.DockerSpawner. ...
    extra_create_kwargs = Dict(config=True, help="Additional args to pass for container create")
    extra_start_kwargs = Dict(config=True, help="Additional args to pass for container start")
    extra_host_config = Dict(config=True, help="Additional args to create_host_config for container create")
    

    Any ideas?

    P.S.: This question is somewhat related to Shared, writable folders in jupyterhub

  • Why NPM is not available in Docker Conainter
  • Build custom Docker microsoft dotnet image with NuGet packages already downloaded
  • Docker containers in real life
  • Flask web app, Node.js (queue) worker. Can't make docker work
  • Docker Best Practises: at what size application should you refrain from containerising?
  • Docker swarm and ec2, how to advertise external ip address
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.