You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -9,8 +9,9 @@
9
9
Jupyter Docker Stacks are a set of ready-to-run [Docker images](https://hub.docker.com/u/jupyter) containing Jupyter applications and interactive computing tools.
10
10
You can use a stack image to do any of the following (and more):
11
11
12
+
- Start a personal Jupyter Server with JupyterLab frontend (default)
13
+
- Run JupyterLab for a team using JupyterHub
12
14
- Start a personal Jupyter Notebook server in a local Docker container
13
-
- Run JupyterLab servers for a team using JupyterHub
14
15
- Write your own project Dockerfile
15
16
16
17
## Quick Start
@@ -48,7 +49,7 @@ This command pulls the `jupyter/datascience-notebook` image tagged `b418b67c225b
48
49
It then starts an _ephemeral_ container running a Jupyter Server and exposes the server on host port 10000.
49
50
50
51
```bash
51
-
docker run --rm -p 10000:8888 -v "${PWD}":/home/jovyan/work jupyter/datascience-notebook:b418b67c225b
52
+
docker run -it --rm -p 10000:8888 -v "${PWD}":/home/jovyan/work jupyter/datascience-notebook:b418b67c225b
52
53
```
53
54
54
55
The use of the `-v` flag in the command mounts the current working directory on the host (`{PWD}` in the example command) as `/home/jovyan/work` in the container.
@@ -58,6 +59,7 @@ Visiting `http://<hostname>:10000/?token=<token>` in a browser loads JupyterLab.
58
59
59
60
Due to the usage of [the flag `--rm`](https://docs.docker.com/engine/reference/run/#clean-up---rm) Docker automatically cleans up the container and removes the file
60
61
system when the container exits, but any changes made to the `~/work` directory and its files in the container will remain intact on the host.
@@ -86,8 +88,8 @@ We will happily grant additional permissions (e.g., ability to merge PRs) to any
86
88
87
89
Following [Jupyter Notebook notice](https://github.com/jupyter/notebook#notice), JupyterLab is now the default for all of the Jupyter Docker stack images.
88
90
It is still possible to switch back to Jupyter Notebook (or to launch a different startup command).
89
-
You can achieve this by passing the environment variable `DOCKER_STACKS_JUPYTER_CMD=notebook` (or any other valid `jupyter`command) at container startup,
90
-
more information is available in the [documentation](https://jupyter-docker-stacks.readthedocs.io/en/latest/using/common.html#docker-options).
91
+
You can achieve this by passing the environment variable `DOCKER_STACKS_JUPYTER_CMD=notebook` (or any other valid `jupyter`subcommand) at container startup,
92
+
more information is available in the [documentation](https://jupyter-docker-stacks.readthedocs.io/en/latest/using/common.html#alternative-commands).
91
93
92
94
According to the Jupyter Notebook project status and its compatibility with JupyterLab,
93
95
these Docker images may remove the classic Jupyter Notebook interface altogether in favor of another _classic-like_ UI built atop JupyterLab.
Copy file name to clipboardExpand all lines: docs/using/common.md
+42-38Lines changed: 42 additions & 38 deletions
Original file line number
Diff line number
Diff line change
@@ -1,29 +1,29 @@
1
1
# Common Features
2
2
3
-
By default, a container launched from any Jupyter Docker Stacks image runs a Jupyter Notebook server.
3
+
By default, a container launched from any Jupyter Docker Stacks image runs a Jupyter Server with JupyterLab frontend.
4
4
The container does so by executing a `start-notebook.sh` script.
5
-
This script configures the internal container environment and then runs `jupyter notebook`, passing any command line arguments received.
5
+
This script configures the internal container environment and then runs `jupyter lab`, passing any command line arguments received.
6
6
7
7
This page describes the options supported by the startup script and how to bypass it to run alternative commands.
8
8
9
-
## Notebook Options
9
+
## Jupyter Server Options
10
10
11
-
You can pass [Jupyter command line options](https://jupyter-notebook.readthedocs.io/en/stable/config.html#options) to the `start-notebook.sh` script when launching the container.
12
-
For example, to secure the Notebook server with a custom password hashed using `IPython.lib.passwd()` instead of the default token, you can run the following:
11
+
You can pass [Jupyter server options](https://jupyter-notebook.readthedocs.io/en/stable/public_server.html) to the `start-notebook.sh` script when launching the container.
2. To set the [base URL](https://jupyter-notebook.readthedocs.io/en/stable/public_server.html#running-the-notebook-with-a-customized-url-prefix) of the notebook server, you can run the following:
22
+
23
+
```bash
24
+
docker run -it --rm -p 8888:8888 jupyter/base-notebook \
-`-e NB_UID=<numeric uid>` - Instructs the startup script to switch the numeric user ID of `${NB_USER}` to the given value.
@@ -104,7 +108,8 @@ You do so by passing arguments to the `docker run` command.
104
108
105
109
### Additional runtime configurations
106
110
107
-
-`-e GEN_CERT=yes` - Instructs the startup script to generate a self-signed SSL certificate and configure Jupyter Notebook to use it to accept encrypted HTTPS connections.
111
+
-`-e GEN_CERT=yes` - Instructs the startup script to generate a self-signed SSL certificate.
112
+
Configures Jupyter Server to use it to accept encrypted HTTPS connections.
108
113
-`-e DOCKER_STACKS_JUPYTER_CMD=<jupyter command>` - Instructs the startup script to run `jupyter ${DOCKER_STACKS_JUPYTER_CMD}` instead of the default `jupyter lab` command.
109
114
See [Switching back to the classic notebook or using a different startup command][switch_back] for available options.
110
115
This setting is helpful in container orchestration environments where setting environment variables is more straightforward than changing command line parameters.
@@ -115,29 +120,31 @@ You do so by passing arguments to the `docker run` command.
115
120
**You must grant the within-container notebook user or group (`NB_UID` or `NB_GID`) write access to the host directory (e.g., `sudo chown 1000 /some/host/folder/for/work`).**
116
121
-`-e JUPYTER_ENV_VARS_TO_UNSET=ADMIN_SECRET_1,ADMIN_SECRET_2` - Unsets specified environment variables in the default startup script.
117
122
The variables are unset after the hooks have been executed but before the command provided to the startup script runs.
118
-
-`-e NOTEBOOK_ARGS="--log-level='DEBUG' --dev-mode"` - Adds custom options to launch `jupyter lab` or `jupyter notebook`. This way, the user could use any option supported by `jupyter`.
123
+
-`-e NOTEBOOK_ARGS="--log-level='DEBUG' --dev-mode"` - Adds custom options to add to `jupyter` commands.
124
+
This way, the user could use any option supported by `jupyter` subcommand.
119
125
120
126
## Startup Hooks
121
127
122
128
You can further customize the container environment by adding shell scripts (`*.sh`) to be sourced
123
129
or executables (`chmod +x`) to be run to the paths below:
124
130
125
-
-`/usr/local/bin/start-notebook.d/` - handled before any of the standard options noted above
126
-
are applied
127
-
-`/usr/local/bin/before-notebook.d/` - handled after all of the standard options noted above are applied and ran right before the notebook server launches
131
+
-`/usr/local/bin/start-notebook.d/` - handled **before** any of the standard options noted above are applied
132
+
-`/usr/local/bin/before-notebook.d/` - handled **after** all of the standard options noted above are applied
133
+
and ran right before the notebook server launches
128
134
129
135
See the `run-hooks` function in the [`jupyter/base-notebook start.sh`](https://github.com/jupyter/docker-stacks/blob/master/base-notebook/start.sh)
130
136
script for execution details.
131
137
132
138
## SSL Certificates
133
139
134
-
You may mount an SSL key and certificate file into a container and configure the Jupyter Notebook to use them to accept HTTPS connections.
140
+
You may mount an SSL key and certificate file into a container and configure the Jupyter Server to use them to accept HTTPS connections.
135
141
For example, to mount a host folder containing a `notebook.key` and `notebook.crt` and use them, you might run the following:
@@ -210,12 +220,6 @@ For example, to run the text-based `ipython` console in a container, do the foll
210
220
docker run -it --rm jupyter/base-notebook start.sh ipython
211
221
```
212
222
213
-
Or, to run Jupyter Notebook classic instead of JupyterLab, run the following:
214
-
215
-
```bash
216
-
docker run -it --rm -p 8888:8888 jupyter/base-notebook start.sh jupyter notebook
217
-
```
218
-
219
223
This script is handy when you derive a new Dockerfile from this image and install additional Jupyter applications with subcommands like `jupyter console`, `jupyter kernelgateway`, etc.
220
224
221
225
### Others
@@ -230,7 +234,7 @@ The `/opt/conda/bin` directory is part of the default `jovyan` user's `${PATH}`.
230
234
That directory is also searched for binaries when run using `sudo` (`sudo my_binary` will search for `my_binary` in `/opt/conda/bin/`
231
235
232
236
The `jovyan` user has full read/write access to the `/opt/conda` directory.
233
-
You can use either `pip`, `conda` or `mamba` to install new packages without any additional permissions.
237
+
You can use either `mamba`, `pip` or `conda` (`mamba` is recommended) to install new packages without any additional permissions.
234
238
235
239
```bash
236
240
# install a package into the default (python 3.x) environment and cleanup after
Copy file name to clipboardExpand all lines: docs/using/recipes.md
+11-6Lines changed: 11 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -9,13 +9,15 @@ The sections below capture this knowledge.
9
9
Password authentication is disabled for the `NB_USER` (e.g., `jovyan`).
10
10
We made this choice to avoid distributing images with a weak default password that users ~might~ will forget to change before running a container on a publicly accessible host.
11
11
12
-
You can grant the within-container `NB_USER` passwordless `sudo` access by adding `-e GRANT_SUDO=yes` and `--user root` to your Docker command line or appropriate container orchestrator config.
12
+
You can grant the within-container `NB_USER` passwordless `sudo` access by adding `--user root` and `-e GRANT_SUDO=yes` to your Docker command line or appropriate container orchestrator config.
13
13
14
14
For example:
15
15
16
16
```bash
17
-
docker run -it -e GRANT_SUDO=yes \
18
-
--user root jupyter/minimal-notebook
17
+
docker run -it --rm \
18
+
--user root \
19
+
-e GRANT_SUDO=yes \
20
+
jupyter/minimal-notebook
19
21
```
20
22
21
23
**You should only enable `sudo` if you trust the user and/or if the container is running on an isolated host.**
0 commit comments