Configfiles for dockerized-jupyterhub
- Docker image: https://hub.docker.com/r/jasonjwilliamsny/ubuntu-jhub-dev3.0/
- Docker pull command:
docker pull jasonjwilliamsny/ubuntu-jhub-dev3.0
-
Clone this repo and place
jupyterhub-persistant/
in a convenient location on your server. Injupyterhub-persistant/
editusernames.txt
; this file should have one or more valid linux username(s) (one name per line). Accounts will be created in your container for each user. The sample list hasuser1
,user2
, anduser3
. Usernames have passwords such that:some_username.123
.tip: You can edit the password in line 16 of
createusers.sh
password=$(openssl passwd -1 -salt xyz $base'.123')
currently appends.123
to the end of the username (which is also = to $base in this line)Note: Your user will have a home directory at
/home/$user
This will be a symbolic link to a folderjupyterhub-persistant/$user
that will be created on the machine running the docker container. In this way, data and changes made by the user on the hub will exist persistently outside of the container.
-
You should setup at least one user from your username list to be a hub admin user. In the
jupyterhub_config.py
file, editc.Authenticator.admin_users
. Include in the brackets quoted, comma-separated usernames.# remember to uncomment this line after editing c.Authenticator.admin_users = {"user_foo","user_bar"}
-
Place
jupyterhub-persistant/
in a suitable location on the machine where Docker is hosted. The-v
option used at execution will bind this folder. -
Make sure
/jupyterhub-persistant/createusers.sh
is executable:chmod +x SOMEPATH/jupyterhub-persistant/createusers.sh
-
Pull the image from dockerhub
docker pull jasonjwilliamsny/ubuntu-jhub-dev3.0
-
Start the container with this command (remember to edit the location of
jupyterhub-persistant/
and use the full path)docker run -p 8000:8000 --name jupyterhub -d -v FULL-PATH-TO/jupyter-persistant:/jupyter-persistant jasonjwilliamsny/ubuntu-jhub-dev3.0:latest
You can also add options to explicitly allow cpu/memory usage
docker run -p 8000:8000 --cpus="16" --memory=60g --name jupyterhub -d -v SOMEPATH/jupyter-persistant:/jupyter-persistant jasonjwilliamsny/ubuntu-jhub-dev3.0:latest
-
Docker will be available at the ip address of the machine
localhost:8000
Tip: Using the Hub's Terminal, have users clone a repo of notebooks into their home directory.
- add instruction for certificate creation for SSL
- Docker container must have enough resources (CPU/MEM/DISK) to run a container with many users (need to test)