Commit 9089b66a authored by Peter Parente's avatar Peter Parente Committed by GitHub

Merge pull request #539 from clkao/jupterhub-lab

jupyterhub-lab support will be enabled if $JUPYTER_ENABLE_LAB is set.
parents 29b68cd9 94657c26
...@@ -29,6 +29,12 @@ Take note of the authentication token included in the notebook startup log messa ...@@ -29,6 +29,12 @@ Take note of the authentication token included in the notebook startup log messa
The Docker container executes a [`start-notebook.sh` script](./start-notebook.sh) script by default. The `start-notebook.sh` script handles the `NB_UID`, `NB_GID` and `GRANT_SUDO` features documented in the next section, and then executes the `jupyter notebook`. The Docker container executes a [`start-notebook.sh` script](./start-notebook.sh) script by default. The `start-notebook.sh` script handles the `NB_UID`, `NB_GID` and `GRANT_SUDO` features documented in the next section, and then executes the `jupyter notebook`.
You can launch [JupyterLab](https://github.com/jupyterlab/jupyterlab) by setting `JUPYTER_ENABLE_LAB`:
```
docker run -it --rm -e JUPYTER_ENABLE_LAB=1 --rm -p 8888:8888 jupyter/base-notebook
```
You can pass [Jupyter command line options](https://jupyter.readthedocs.io/en/latest/projects/jupyter-command.html) through the `start-notebook.sh` script when launching the container. For example, to secure the Notebook server with a custom password hashed using `IPython.lib.passwd()` instead of the default token, run the following: You can pass [Jupyter command line options](https://jupyter.readthedocs.io/en/latest/projects/jupyter-command.html) through the `start-notebook.sh` script when launching the container. For example, to secure the Notebook server with a custom password hashed using `IPython.lib.passwd()` instead of the default token, run the following:
``` ```
......
...@@ -8,5 +8,9 @@ if [[ ! -z "${JUPYTERHUB_API_TOKEN}" ]]; then ...@@ -8,5 +8,9 @@ if [[ ! -z "${JUPYTERHUB_API_TOKEN}" ]]; then
# launched by JupyterHub, use single-user entrypoint # launched by JupyterHub, use single-user entrypoint
exec /usr/local/bin/start-singleuser.sh $* exec /usr/local/bin/start-singleuser.sh $*
else else
if [[ ! -z "${JUPYTER_ENABLE_LAB}" ]]; then
. /usr/local/bin/start.sh jupyter lab $*
else
. /usr/local/bin/start.sh jupyter notebook $* . /usr/local/bin/start.sh jupyter notebook $*
fi
fi fi
...@@ -34,5 +34,10 @@ fi ...@@ -34,5 +34,10 @@ fi
if [ ! -z "$JPY_HUB_API_URL" ]; then if [ ! -z "$JPY_HUB_API_URL" ]; then
NOTEBOOK_ARGS="--hub-api-url=$JPY_HUB_API_URL $NOTEBOOK_ARGS" NOTEBOOK_ARGS="--hub-api-url=$JPY_HUB_API_URL $NOTEBOOK_ARGS"
fi fi
if [ ! -z "$JUPYTER_ENABLE_LAB" ]; then
NOTEBOOK_BIN="jupyter labhub"
else
NOTEBOOK_BIN=jupyterhub-singleuser
fi
. /usr/local/bin/start.sh jupyterhub-singleuser $NOTEBOOK_ARGS $@ . /usr/local/bin/start.sh $NOTEBOOK_BIN $NOTEBOOK_ARGS $@
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment