From ec8addb64b3bb40c5f822804c6096d9529599626 Mon Sep 17 00:00:00 2001 From: rigzba21 Date: Wed, 26 Jan 2022 20:07:18 -0500 Subject: [PATCH 01/11] updating Docker Options overview text, and editing NB_UMASK description --- docs/using/common.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/using/common.md b/docs/using/common.md index 18af9731..247abcea 100644 --- a/docs/using/common.md +++ b/docs/using/common.md @@ -21,16 +21,16 @@ For example, to set the base URL of the notebook server, you can run the followi docker run -d -p 8888:8888 jupyter/base-notebook start-notebook.sh --NotebookApp.base_url=/some/path ``` -## Docker Options +## Docker Environment Variable Options +Several configurable environment variables exist that allow for customizing the container environment before +launching the notebook server. These environment variables are configured by passing arguments to the +`docker run` command. -You may instruct the `start-notebook.sh` script to customize the container environment before launching -the notebook server. -You do so by passing arguments to the `docker run` command. - -- `-e NB_USER=jovyan` - Instructs the startup script to change the default container username from `jovyan` to the provided value. +- `-e NB_USER=` - Instructs the startup script to change the default container username from `jovyan` to the provided value. Causes the script to rename the `jovyan` user home folder. For this option to take effect, you must run the container with `--user root`, set the working directory `-w /home/${NB_USER}` and set the environment variable `-e CHOWN_HOME=yes` (see below for detail). This feature is useful when mounting host volumes with specific home folder. + Example usage: - `-e NB_UID=1000` - Instructs the startup script to switch the numeric user ID of `${NB_USER}` to the given value. This feature is useful when mounting host volumes with specific owner permissions. For this option to take effect, you must run the container with `--user root`. @@ -48,13 +48,13 @@ You do so by passing arguments to the `docker run` command. If you override the user/group logic, ensure the user stays in group `users` if you want them to be able to modify files in the image. - `-e NB_GROUP=` - The name used for `${NB_GID}`, which defaults to `${NB_USER}`. This is only used if `${NB_GID}` is specified and completely optional: there is only cosmetic effect. -- `-e NB_UMASK=` - Configures Jupyter to use a different umask value from default, i.e. `022`. - For example, if setting umask to `002`, new files will be readable and writable by group members instead of just writable by the owner. - Wikipedia has a good article about [umask](https://en.wikipedia.org/wiki/Umask). - Feel free to read it in order to choose the value that better fits your needs. - Default value should fit most situations. - Note that `NB_UMASK` when set only applies to the Jupyter process itself - you cannot use it to set a umask for additional files created during run-hooks - e.g. via `pip` or `conda` - if you need to set a umask for these you must set `umask` for each command. + +- `-e NB_UMASK=` - Configures Jupyter to use a different `umask` value from default, i.e. `022`. + For example, if setting `umask` to `002`, new files will be readable and writable by group members instead of just writable by the owner. + Wikipedia has a good article about [`umask`](https://en.wikipedia.org/wiki/Umask). While the default `umask` value should be sufficient for most use cases, you can set the `NB_UMASK` value to fit your requirements. _Note that `NB_UMASK` when set only applies to the Jupyter process itself - you cannot use it to set a + `umask` for additional files created during run-hooks. For example, via `pip` or `conda`. If you need to set a `umask` for these you must set `umask` for + each command._ + - `-e CHOWN_HOME=yes` - Instructs the startup script to change the `${NB_USER}` home directory owner and group to the current value of `${NB_UID}` and `${NB_GID}`. This change will take effect even if the user home directory is mounted from the host using `-v` as described below. The change is **not** applied recursively by default. From c3382f76da9f96d0a472ee32f53b050f687c370c Mon Sep 17 00:00:00 2001 From: rigzba21 Date: Thu, 27 Jan 2022 06:53:30 -0500 Subject: [PATCH 02/11] adding to NB_USER environment variable option description --- docs/using/common.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/using/common.md b/docs/using/common.md index 247abcea..d927df38 100644 --- a/docs/using/common.md +++ b/docs/using/common.md @@ -26,11 +26,9 @@ Several configurable environment variables exist that allow for customizing the launching the notebook server. These environment variables are configured by passing arguments to the `docker run` command. -- `-e NB_USER=` - Instructs the startup script to change the default container username from `jovyan` to the provided value. - Causes the script to rename the `jovyan` user home folder. - For this option to take effect, you must run the container with `--user root`, set the working directory `-w /home/${NB_USER}` and set the environment variable `-e CHOWN_HOME=yes` (see below for detail). - This feature is useful when mounting host volumes with specific home folder. - Example usage: +- `-e NB_USER=` - The desired username and associated home folder. Default value is `jovyan`. Setting `NB_USER` refits the `jovyan` + default user and ensures that the desired user has the correct file permissions for the new home directory that gets created at + `/home/`. Use this environment variable argument when mounting host volumes with a specific home folder. - `-e NB_UID=1000` - Instructs the startup script to switch the numeric user ID of `${NB_USER}` to the given value. This feature is useful when mounting host volumes with specific owner permissions. For this option to take effect, you must run the container with `--user root`. From e8c8a1eabaad58dc9e31854f269294601fa8db7e Mon Sep 17 00:00:00 2001 From: rigzba21 Date: Thu, 27 Jan 2022 08:07:09 -0500 Subject: [PATCH 03/11] adding example usage for NB_USER environment variable option --- docs/using/common.md | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/docs/using/common.md b/docs/using/common.md index d927df38..7f35d4e0 100644 --- a/docs/using/common.md +++ b/docs/using/common.md @@ -21,20 +21,23 @@ For example, to set the base URL of the notebook server, you can run the followi docker run -d -p 8888:8888 jupyter/base-notebook start-notebook.sh --NotebookApp.base_url=/some/path ``` -## Docker Environment Variable Options -Several configurable environment variables exist that allow for customizing the container environment before -launching the notebook server. These environment variables are configured by passing arguments to the -`docker run` command. +## Docker Options + +You may instruct the `start-notebook.sh` script to customize the container environment before launching the notebook server. You do so by passing +arguments to the `docker run` command. - `-e NB_USER=` - The desired username and associated home folder. Default value is `jovyan`. Setting `NB_USER` refits the `jovyan` default user and ensures that the desired user has the correct file permissions for the new home directory that gets created at - `/home/`. Use this environment variable argument when mounting host volumes with a specific home folder. -- `-e NB_UID=1000` - Instructs the startup script to switch the numeric user ID of `${NB_USER}` to the given value. - This feature is useful when mounting host volumes with specific owner permissions. - For this option to take effect, you must run the container with `--user root`. - (The startup script will `su ${NB_USER}` after adjusting the user ID.) - You might consider using modern Docker options `--user` and `--group-add` instead. - See the last bullet below for details. + `/home/`. For this option to take effect you must run the container with `--user root`, set the working directory `-w /home/${NB_USER}` + and set the environment variable `-e CHOWN_HOME=yes`. + Example Usage: + `docker run --rm -it -p 8888:8888 -e NB_USER="my-username" -e CHOWN_HOME=yes -w /home/${NB_USER} --user root jupyter/base-notebook:latest` + +- `-e NB_UID=1000` - Instructs the startup script to switch the numeric user ID of `${NB_USER}` to the given value. Default value is `1000`. + This feature is useful when mounting host volumes with specific owner permissions. For this option to take effect, you must run the container + with `--user root`. (The startup script will `su ${NB_USER}` after adjusting the user ID.) You might consider using the modern Docker options + `--user` and `--group-add` instead. See bullet points regarding `--user` and `--group-add`. + - `-e NB_GID=100` - Instructs the startup script to change the primary group of`${NB_USER}` to `${NB_GID}` (the new group is added with a name of `${NB_GROUP}` if it is defined, otherwise the group is named `${NB_USER}`). This feature is useful when mounting host volumes with specific group permissions. @@ -44,6 +47,7 @@ launching the notebook server. These environment variables are configured by pas See the last bullet below for details. The user is added to supplemental group `users` (gid 100) in order to allow write access to the home directory and `/opt/conda`. If you override the user/group logic, ensure the user stays in group `users` if you want them to be able to modify files in the image. + - `-e NB_GROUP=` - The name used for `${NB_GID}`, which defaults to `${NB_USER}`. This is only used if `${NB_GID}` is specified and completely optional: there is only cosmetic effect. @@ -57,28 +61,37 @@ launching the notebook server. These environment variables are configured by pas This change will take effect even if the user home directory is mounted from the host using `-v` as described below. The change is **not** applied recursively by default. You can change modify the `chown` behavior by setting `CHOWN_HOME_OPTS` (e.g., `-e CHOWN_HOME_OPTS='-R'`). + - `-e CHOWN_EXTRA=","` - Instructs the startup script to change the owner and group of each comma-separated container directory to the current value of `${NB_UID}` and `${NB_GID}`. The change is **not** applied recursively by default. You can change modify the `chown` behavior by setting `CHOWN_EXTRA_OPTS` (e.g., `-e CHOWN_EXTRA_OPTS='-R'`). + - `-e GRANT_SUDO=yes` - Instructs the startup script to grant the `NB_USER` user passwordless `sudo` capability. You do **not** need this option to allow the user to `conda` or `pip` install additional packages. This option is useful, however, when you wish to give `${NB_USER}` the ability to install OS packages with `apt` or modify other root-owned files in the container. For this option to take effect, you must run the container with `--user root`. (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 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. This may be useful when you need to install extensions that require restarting Jupyter. + - `-v /some/host/folder/for/work:/home/jovyan/work` - Mounts a host machine directory as folder in the container. Useful when you want to preserve notebooks and other work even after the container is destroyed. **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`).** + - `--user 5000 --group-add users` - Launches the container with a specific user ID and adds that user to the `users` group so that it can modify files in the default home directory and `/opt/conda`. You can use these arguments as alternatives to setting `${NB_UID}` and `${NB_GID}`. + - `-e JUPYTER_ENV_VARS_TO_UNSET=ADMIN_SECRET_1,ADMIN_SECRET_2` - Unsets specified environment variables in the default startup script. The variables are unset after the hooks have executed but before the command provided to the startup script runs. + - `-e NOTEBOOK_ARGS="--log-level='DEBUG' --dev-mode"` - Adds custom options to launch `jupyter lab` or `jupyter notebook`. This way any option, supported by `jupyter` could be used by the user. ## Startup Hooks From 3ee9b21afba1693028fa6c22725d23fc277c1e91 Mon Sep 17 00:00:00 2001 From: rigzba21 Date: Thu, 27 Jan 2022 08:08:46 -0500 Subject: [PATCH 04/11] fixing formatting --- docs/using/common.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/using/common.md b/docs/using/common.md index 7f35d4e0..e33f78cf 100644 --- a/docs/using/common.md +++ b/docs/using/common.md @@ -30,8 +30,12 @@ arguments to the `docker run` command. default user and ensures that the desired user has the correct file permissions for the new home directory that gets created at `/home/`. For this option to take effect you must run the container with `--user root`, set the working directory `-w /home/${NB_USER}` and set the environment variable `-e CHOWN_HOME=yes`. + Example Usage: - `docker run --rm -it -p 8888:8888 -e NB_USER="my-username" -e CHOWN_HOME=yes -w /home/${NB_USER} --user root jupyter/base-notebook:latest` + + ```bash + docker run --rm -it -p 8888:8888 -e NB_USER="my-username" -e CHOWN_HOME=yes -w /home/${NB_USER} --user root jupyter/base-notebook:latest + ``` - `-e NB_UID=1000` - Instructs the startup script to switch the numeric user ID of `${NB_USER}` to the given value. Default value is `1000`. This feature is useful when mounting host volumes with specific owner permissions. For this option to take effect, you must run the container From 517ca157f38d7791c01670868b3dcba321bcd980 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 27 Jan 2022 13:14:45 +0000 Subject: [PATCH 05/11] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/using/common.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/using/common.md b/docs/using/common.md index e33f78cf..79345f95 100644 --- a/docs/using/common.md +++ b/docs/using/common.md @@ -23,14 +23,14 @@ docker run -d -p 8888:8888 jupyter/base-notebook start-notebook.sh --NotebookApp ## Docker Options -You may instruct the `start-notebook.sh` script to customize the container environment before launching the notebook server. You do so by passing +You may instruct the `start-notebook.sh` script to customize the container environment before launching the notebook server. You do so by passing arguments to the `docker run` command. - `-e NB_USER=` - The desired username and associated home folder. Default value is `jovyan`. Setting `NB_USER` refits the `jovyan` - default user and ensures that the desired user has the correct file permissions for the new home directory that gets created at + default user and ensures that the desired user has the correct file permissions for the new home directory that gets created at `/home/`. For this option to take effect you must run the container with `--user root`, set the working directory `-w /home/${NB_USER}` and set the environment variable `-e CHOWN_HOME=yes`. - + Example Usage: ```bash @@ -38,8 +38,8 @@ arguments to the `docker run` command. ``` - `-e NB_UID=1000` - Instructs the startup script to switch the numeric user ID of `${NB_USER}` to the given value. Default value is `1000`. - This feature is useful when mounting host volumes with specific owner permissions. For this option to take effect, you must run the container - with `--user root`. (The startup script will `su ${NB_USER}` after adjusting the user ID.) You might consider using the modern Docker options + This feature is useful when mounting host volumes with specific owner permissions. For this option to take effect, you must run the container + with `--user root`. (The startup script will `su ${NB_USER}` after adjusting the user ID.) You might consider using the modern Docker options `--user` and `--group-add` instead. See bullet points regarding `--user` and `--group-add`. - `-e NB_GID=100` - Instructs the startup script to change the primary group of`${NB_USER}` to `${NB_GID}` @@ -57,8 +57,8 @@ arguments to the `docker run` command. - `-e NB_UMASK=` - Configures Jupyter to use a different `umask` value from default, i.e. `022`. For example, if setting `umask` to `002`, new files will be readable and writable by group members instead of just writable by the owner. - Wikipedia has a good article about [`umask`](https://en.wikipedia.org/wiki/Umask). While the default `umask` value should be sufficient for most use cases, you can set the `NB_UMASK` value to fit your requirements. _Note that `NB_UMASK` when set only applies to the Jupyter process itself - you cannot use it to set a - `umask` for additional files created during run-hooks. For example, via `pip` or `conda`. If you need to set a `umask` for these you must set `umask` for + Wikipedia has a good article about [`umask`](https://en.wikipedia.org/wiki/Umask). While the default `umask` value should be sufficient for most use cases, you can set the `NB_UMASK` value to fit your requirements. _Note that `NB_UMASK` when set only applies to the Jupyter process itself - you cannot use it to set a + `umask` for additional files created during run-hooks. For example, via `pip` or `conda`. If you need to set a `umask` for these you must set `umask` for each command._ - `-e CHOWN_HOME=yes` - Instructs the startup script to change the `${NB_USER}` home directory owner and group to the current value of `${NB_UID}` and `${NB_GID}`. From 844622a0caec90b819fc7419d46f3e29213a2f81 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Thu, 27 Jan 2022 20:48:19 +0300 Subject: [PATCH 06/11] Add quotes --- docs/using/common.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/using/common.md b/docs/using/common.md index 79345f95..061fd235 100644 --- a/docs/using/common.md +++ b/docs/using/common.md @@ -28,13 +28,13 @@ arguments to the `docker run` command. - `-e NB_USER=` - The desired username and associated home folder. Default value is `jovyan`. Setting `NB_USER` refits the `jovyan` default user and ensures that the desired user has the correct file permissions for the new home directory that gets created at - `/home/`. For this option to take effect you must run the container with `--user root`, set the working directory `-w /home/${NB_USER}` + `/home/`. For this option to take effect you must run the container with `--user root`, set the working directory `-w "/home/${NB_USER}"` and set the environment variable `-e CHOWN_HOME=yes`. Example Usage: ```bash - docker run --rm -it -p 8888:8888 -e NB_USER="my-username" -e CHOWN_HOME=yes -w /home/${NB_USER} --user root jupyter/base-notebook:latest + docker run --rm -it -p 8888:8888 -e NB_USER="my-username" -e CHOWN_HOME=yes -w "/home/${NB_USER}" --user root jupyter/base-notebook:latest ``` - `-e NB_UID=1000` - Instructs the startup script to switch the numeric user ID of `${NB_USER}` to the given value. Default value is `1000`. From 33db75ed46582d9a9d59140d531cea7a5b4a10cc Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Thu, 27 Jan 2022 20:52:14 +0300 Subject: [PATCH 07/11] Do not hardcode values --- docs/using/common.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/using/common.md b/docs/using/common.md index 061fd235..ef8cc206 100644 --- a/docs/using/common.md +++ b/docs/using/common.md @@ -37,12 +37,12 @@ arguments to the `docker run` command. docker run --rm -it -p 8888:8888 -e NB_USER="my-username" -e CHOWN_HOME=yes -w "/home/${NB_USER}" --user root jupyter/base-notebook:latest ``` -- `-e NB_UID=1000` - Instructs the startup script to switch the numeric user ID of `${NB_USER}` to the given value. Default value is `1000`. +- `-e NB_UID=` - Instructs the startup script to switch the numeric user ID of `${NB_USER}` to the given value. Default value is `1000`. This feature is useful when mounting host volumes with specific owner permissions. For this option to take effect, you must run the container with `--user root`. (The startup script will `su ${NB_USER}` after adjusting the user ID.) You might consider using the modern Docker options `--user` and `--group-add` instead. See bullet points regarding `--user` and `--group-add`. -- `-e NB_GID=100` - Instructs the startup script to change the primary group of`${NB_USER}` to `${NB_GID}` +- `-e NB_GID=` - Instructs the startup script to change the primary group of`${NB_USER}` to `${NB_GID}` (the new group is added with a name of `${NB_GROUP}` if it is defined, otherwise the group is named `${NB_USER}`). This feature is useful when mounting host volumes with specific group permissions. For this option to take effect, you must run the container with `--user root`. From 36d468626a86dc6f9a7cf1133d0c9ab181bf1b34 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Thu, 27 Jan 2022 21:10:06 +0300 Subject: [PATCH 08/11] Better style --- docs/using/common.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/using/common.md b/docs/using/common.md index ef8cc206..bb7b052e 100644 --- a/docs/using/common.md +++ b/docs/using/common.md @@ -23,15 +23,15 @@ docker run -d -p 8888:8888 jupyter/base-notebook start-notebook.sh --NotebookApp ## Docker Options -You may instruct the `start-notebook.sh` script to customize the container environment before launching the notebook server. You do so by passing -arguments to the `docker run` command. +You may instruct the `start-notebook.sh` script to customize the container environment before launching the notebook server. +You do so by passing arguments to the `docker run` command. - `-e NB_USER=` - The desired username and associated home folder. Default value is `jovyan`. Setting `NB_USER` refits the `jovyan` default user and ensures that the desired user has the correct file permissions for the new home directory that gets created at `/home/`. For this option to take effect you must run the container with `--user root`, set the working directory `-w "/home/${NB_USER}"` and set the environment variable `-e CHOWN_HOME=yes`. - Example Usage: + Example usage: ```bash docker run --rm -it -p 8888:8888 -e NB_USER="my-username" -e CHOWN_HOME=yes -w "/home/${NB_USER}" --user root jupyter/base-notebook:latest @@ -39,7 +39,7 @@ arguments to the `docker run` command. - `-e NB_UID=` - Instructs the startup script to switch the numeric user ID of `${NB_USER}` to the given value. Default value is `1000`. This feature is useful when mounting host volumes with specific owner permissions. For this option to take effect, you must run the container - with `--user root`. (The startup script will `su ${NB_USER}` after adjusting the user ID.) You might consider using the modern Docker options + with `--user root`. (The startup script will `su ${NB_USER}` after adjusting the user ID.) You might consider using modern Docker options `--user` and `--group-add` instead. See bullet points regarding `--user` and `--group-add`. - `-e NB_GID=` - Instructs the startup script to change the primary group of`${NB_USER}` to `${NB_GID}` From 4e83d109b264b18362f87c6e45d975d9f06cc76a Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Thu, 27 Jan 2022 21:13:27 +0300 Subject: [PATCH 09/11] Match the docs style --- docs/using/common.md | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/docs/using/common.md b/docs/using/common.md index bb7b052e..3675b926 100644 --- a/docs/using/common.md +++ b/docs/using/common.md @@ -26,9 +26,11 @@ docker run -d -p 8888:8888 jupyter/base-notebook start-notebook.sh --NotebookApp You may instruct the `start-notebook.sh` script to customize the container environment before launching the notebook server. You do so by passing arguments to the `docker run` command. -- `-e NB_USER=` - The desired username and associated home folder. Default value is `jovyan`. Setting `NB_USER` refits the `jovyan` - default user and ensures that the desired user has the correct file permissions for the new home directory that gets created at - `/home/`. For this option to take effect you must run the container with `--user root`, set the working directory `-w "/home/${NB_USER}"` +- `-e NB_USER=` - The desired username and associated home folder. + Default value is `jovyan`. + Setting `NB_USER` refits the `jovyan` default user and ensures that the desired user has the correct file permissions + for the new home directory that gets created at `/home/`. + For this option to take effect you must run the container with `--user root`, set the working directory `-w "/home/${NB_USER}"` and set the environment variable `-e CHOWN_HOME=yes`. Example usage: @@ -37,10 +39,13 @@ You do so by passing arguments to the `docker run` command. docker run --rm -it -p 8888:8888 -e NB_USER="my-username" -e CHOWN_HOME=yes -w "/home/${NB_USER}" --user root jupyter/base-notebook:latest ``` -- `-e NB_UID=` - Instructs the startup script to switch the numeric user ID of `${NB_USER}` to the given value. Default value is `1000`. - This feature is useful when mounting host volumes with specific owner permissions. For this option to take effect, you must run the container - with `--user root`. (The startup script will `su ${NB_USER}` after adjusting the user ID.) You might consider using modern Docker options - `--user` and `--group-add` instead. See bullet points regarding `--user` and `--group-add`. +- `-e NB_UID=` - Instructs the startup script to switch the numeric user ID of `${NB_USER}` to the given value. + Default value is `1000`. + This feature is useful when mounting host volumes with specific owner permissions. + For this option to take effect, you must run the container with `--user root`. + (The startup script will `su ${NB_USER}` after adjusting the user ID.) + You might consider using modern Docker options `--user` and `--group-add` instead. + See bullet points regarding `--user` and `--group-add`. - `-e NB_GID=` - Instructs the startup script to change the primary group of`${NB_USER}` to `${NB_GID}` (the new group is added with a name of `${NB_GROUP}` if it is defined, otherwise the group is named `${NB_USER}`). @@ -57,9 +62,12 @@ You do so by passing arguments to the `docker run` command. - `-e NB_UMASK=` - Configures Jupyter to use a different `umask` value from default, i.e. `022`. For example, if setting `umask` to `002`, new files will be readable and writable by group members instead of just writable by the owner. - Wikipedia has a good article about [`umask`](https://en.wikipedia.org/wiki/Umask). While the default `umask` value should be sufficient for most use cases, you can set the `NB_UMASK` value to fit your requirements. _Note that `NB_UMASK` when set only applies to the Jupyter process itself - you cannot use it to set a - `umask` for additional files created during run-hooks. For example, via `pip` or `conda`. If you need to set a `umask` for these you must set `umask` for - each command._ + Wikipedia has a good article about [`umask`](https://en.wikipedia.org/wiki/Umask). + While the default `umask` value should be sufficient for most use cases, you can set the `NB_UMASK` value to fit your requirements. + _Note that `NB_UMASK` when set only applies to the Jupyter process itself - + you cannot use it to set a `umask` for additional files created during run-hooks. + For example, via `pip` or `conda`. + If you need to set a `umask` for these you must set `umask` for each command._ - `-e CHOWN_HOME=yes` - Instructs the startup script to change the `${NB_USER}` home directory owner and group to the current value of `${NB_UID}` and `${NB_GID}`. This change will take effect even if the user home directory is mounted from the host using `-v` as described below. From 2c1cd43504f38607c12a22d831e4a014da5e1e3d Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Thu, 27 Jan 2022 21:18:19 +0300 Subject: [PATCH 10/11] Update common.md --- docs/using/common.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/using/common.md b/docs/using/common.md index 3675b926..ecfbd2e4 100644 --- a/docs/using/common.md +++ b/docs/using/common.md @@ -47,7 +47,7 @@ You do so by passing arguments to the `docker run` command. You might consider using modern Docker options `--user` and `--group-add` instead. See bullet points regarding `--user` and `--group-add`. -- `-e NB_GID=` - Instructs the startup script to change the primary group of`${NB_USER}` to `${NB_GID}` +- `-e NB_GID=` - Instructs the startup script to change the primary group of `${NB_USER}` to `${NB_GID}` (the new group is added with a name of `${NB_GROUP}` if it is defined, otherwise the group is named `${NB_USER}`). This feature is useful when mounting host volumes with specific group permissions. For this option to take effect, you must run the container with `--user root`. From 0eb36d778d8ff32bc57e0c6be43fdc641a72586f Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Sat, 29 Jan 2022 00:54:15 +0300 Subject: [PATCH 11/11] Update recipe to use python 3.7 --- docs/using/recipes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/using/recipes.md b/docs/using/recipes.md index 066185c5..93ecfa2c 100644 --- a/docs/using/recipes.md +++ b/docs/using/recipes.md @@ -106,8 +106,8 @@ To add a conda environment with a different version and make it accessible to Ju FROM jupyter/minimal-notebook:latest # name your environment and choose python 3.x version -ARG conda_env=python36 -ARG py_ver=3.6 +ARG conda_env=python37 +ARG py_ver=3.7 # you can add additional libraries you want mamba to install by listing them below the first line and ending with "&& \" RUN mamba create --quiet --yes -p "${CONDA_DIR}/envs/${conda_env}" python=${py_ver} ipython ipykernel && \