diff --git a/README.md b/README.md index e1924d7d..50282230 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ We will happily grant additional permissions (e.g., ability to merge PRs) to any Following [Jupyter Notebook notice](https://github.com/jupyter/notebook#notice), JupyterLab is now the default for all of the Jupyter Docker stack images. It is still possible to switch back to Jupyter Notebook (or to launch a different startup command). -This can be done by passing the environment variable `JUPYTER_CMD=notebook` (or any other valid `jupyter` command) at container startup, +This can be done by passing the environment variable `DOCKER_STACKS_JUPYTER_CMD=notebook` (or any other valid `jupyter` command) at container startup, more information is available in the [documentation](https://jupyter-docker-stacks.readthedocs.io/en/latest/using/common.html#docker-options). According to the Jupyter Notebook project status and its compatibility with JupyterLab, diff --git a/base-notebook/start-notebook.sh b/base-notebook/start-notebook.sh index 64892dc4..ce47768d 100755 --- a/base-notebook/start-notebook.sh +++ b/base-notebook/start-notebook.sh @@ -6,7 +6,7 @@ set -e # The Jupyter command to launch # JupyterLab by default -JUPYTER_CMD="${JUPYTER_CMD:=lab}" +DOCKER_STACKS_JUPYTER_CMD="${DOCKER_STACKS_JUPYTER_CMD:=lab}" if [[ -n "${JUPYTERHUB_API_TOKEN}" ]]; then echo "WARNING: using start-singleuser.sh instead of start-notebook.sh to start a server associated with JupyterHub." @@ -19,8 +19,8 @@ if [[ "${RESTARTABLE}" == "yes" ]]; then fi if [[ -v JUPYTER_ENABLE_LAB ]]; then - echo "WARNING: JUPYTER_ENABLE_LAB is ignored, use JUPYTER_CMD if you want to change the command used to start the server" + echo "WARNING: JUPYTER_ENABLE_LAB is ignored, use DOCKER_STACKS_JUPYTER_CMD if you want to change the command used to start the server" fi # shellcheck disable=SC1091,SC2086 -exec /usr/local/bin/start.sh ${wrapper} jupyter ${JUPYTER_CMD} ${NOTEBOOK_ARGS} "$@" +exec /usr/local/bin/start.sh ${wrapper} jupyter ${DOCKER_STACKS_JUPYTER_CMD} ${NOTEBOOK_ARGS} "$@" diff --git a/base-notebook/test/test_start_container.py b/base-notebook/test/test_start_container.py index 4295c954..fcc09f5e 100644 --- a/base-notebook/test/test_start_container.py +++ b/base-notebook/test/test_start_container.py @@ -23,11 +23,11 @@ LOGGER = logging.getLogger(__name__) ["WARNING: JUPYTER_ENABLE_LAB is ignored"], ), (None, "jupyter lab", True, []), - (["JUPYTER_CMD=lab"], "jupyter lab", True, []), + (["DOCKER_STACKS_JUPYTER_CMD=lab"], "jupyter lab", True, []), (["RESTARTABLE=yes"], "run-one-constantly jupyter lab", True, []), - (["JUPYTER_CMD=notebook"], "jupyter notebook", True, []), - (["JUPYTER_CMD=server"], "jupyter server", True, []), - (["JUPYTER_CMD=nbclassic"], "jupyter nbclassic", True, []), + (["DOCKER_STACKS_JUPYTER_CMD=notebook"], "jupyter notebook", True, []), + (["DOCKER_STACKS_JUPYTER_CMD=server"], "jupyter server", True, []), + (["DOCKER_STACKS_JUPYTER_CMD=nbclassic"], "jupyter nbclassic", True, []), ( ["JUPYTERHUB_API_TOKEN=my_token"], "jupyterhub-singleuser", diff --git a/docs/using/common.md b/docs/using/common.md index 6277ef96..18af9731 100644 --- a/docs/using/common.md +++ b/docs/using/common.md @@ -69,7 +69,7 @@ You do so by passing arguments to the `docker run` command. (The `start-notebook.sh` script will `su ${NB_USER}` after adding `${NB_USER}` to sudoers.) **You should only enable `sudo` if you trust the user or if the container is running on an isolated host.** - `-e GEN_CERT=yes` - Instructs the startup script to generates a self-signed SSL certificate and configure Jupyter Notebook to use it to accept encrypted HTTPS connections. -- `-e JUPYTER_CMD=` - Instructs the startup script to run `jupyter ${JUPYTER_CMD}` instead of the default `jupyter lab` command. +- `-e DOCKER_STACKS_JUPYTER_CMD=` - Instructs the startup script to run `jupyter ${DOCKER_STACKS_JUPYTER_CMD}` instead of the default `jupyter lab` command. See [Switching back to classic notebook or using a different startup command][switch_back] for available options. Useful in container orchestration environments where setting environment variables is easier than change command line parameters. - `-e RESTARTABLE=yes` - Runs Jupyter in a loop so that quitting Jupyter does not cause the container to exit. @@ -135,16 +135,16 @@ For additional information about using SSL, see the following: JupyterLab built on top of Jupyter Server is now the default for all images of the stack. However, it is still possible to switch back to the classic notebook or to use a different startup command. -This can be done by setting the environment variable `JUPYTER_CMD` at container startup. +This can be done by setting the environment variable `DOCKER_STACKS_JUPYTER_CMD` at container startup. The table below shows some options. -| `JUPYTER_CMD` | Backend | Frontend | -| --------------- | ---------------- | ---------------- | -| `lab` (default) | Jupyter Server | JupyterLab | -| `notebook` | Jupyter Notebook | Jupyter Notebook | -| `nbclassic` | Jupyter Server | Jupyter Notebook | -| `server` | Jupyter Server | None | -| `retro`\* | Jupyter Server | RetroLab | +| `DOCKER_STACKS_JUPYTER_CMD` | Backend | Frontend | +| --------------------------- | ---------------- | ---------------- | +| `lab` (default) | Jupyter Server | JupyterLab | +| `notebook` | Jupyter Notebook | Jupyter Notebook | +| `nbclassic` | Jupyter Server | Jupyter Notebook | +| `server` | Jupyter Server | None | +| `retro`\* | Jupyter Server | RetroLab | Notes: @@ -155,12 +155,12 @@ Example: ```bash # Run Jupyter Notebook classic -docker run -it --rm -p 8888:8888 -e JUPYTER_CMD=notebook \ +docker run -it --rm -p 8888:8888 -e DOCKER_STACKS_JUPYTER_CMD=notebook \ jupyter/base-notebook # Executing the command: jupyter notebook ... # Run Jupyter Notebook on Jupyter Server -docker run -it --rm -p 8888:8888 -e JUPYTER_CMD=nbclassic +docker run -it --rm -p 8888:8888 -e DOCKER_STACKS_JUPYTER_CMD=nbclassic \ jupyter/base-notebook # Executing the command: jupyter nbclassic ... ```