Skip to content

Commit 6ccfd54

Browse files
committed
README.md, CUDA.md: Update section 'Run container'
#1
1 parent 8825cf2 commit 6ccfd54

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

CUDA.md

+10-6
Original file line numberDiff line numberDiff line change
@@ -98,22 +98,26 @@ Create an empty directory:
9898
```bash
9999
mkdir jupyterlab-jovyan
100100
sudo chown 1000:100 jupyterlab-jovyan
101-
cd jupyterlab-jovyan
102101
```
103102

104103
It will be *bind mounted* as the JupyterLab user's home directory and
105104
automatically populated on first run.
106105

107106
### Run container
108107

108+
| :exclamation: Always mount the user's **entire** home directory.<br>Mounting a subfolder prevents the container from starting.[^1] |
109+
|------------------------------------------------------------------------------------------------------------------------------------|
110+
111+
[^1]: The only exception is the use case described at [Jupyter Docker Stacks > Quick Start > Example 2](https://github.com/jupyter/docker-stacks#quick-start).
112+
109113
self built:
110114

111115
```bash
112116
docker run -it --rm \
113117
--gpus '"device=all"' \
114118
-p 8888:8888 \
115119
-u root \
116-
-v "${PWD}":/home/jovyan \
120+
-v "${PWD}/jupyterlab-jovyan":/home/jovyan \
117121
-e NB_UID=$(id -u) \
118122
-e NB_GID=$(id -g) \
119123
-e CHOWN_HOME=yes \
@@ -128,7 +132,7 @@ docker run -it --rm \
128132
--gpus '"device=all"' \
129133
-p 8888:8888 \
130134
-u root \
131-
-v "${PWD}":/home/jovyan \
135+
-v "${PWD}/jupyterlab-jovyan":/home/jovyan \
132136
-e NB_UID=$(id -u) \
133137
-e NB_GID=$(id -g) \
134138
-e CHOWN_HOME=yes \
@@ -141,8 +145,8 @@ docker run -it --rm \
141145
* [`glcr.b-data.ch/jupyterlab/cuda/python/base`](https://gitlab.b-data.ch/jupyterlab/cuda/python/base/container_registry)
142146
* [`glcr.b-data.ch/jupyterlab/cuda/python/scipy`](https://gitlab.b-data.ch/jupyterlab/cuda/python/scipy/container_registry)
143147
144-
The use of the `-v` flag in the command mounts the current working directory on
145-
the host (`${PWD}` in the command) as `/home/jovyan` in the container.
148+
The use of the `-v` flag in the command mounts the empty directory on the host
149+
(`${PWD}/jupyterlab-jovyan` in the command) as `/home/jovyan` in the container.
146150
147151
`-e NB_UID=$(id -u) -e NB_GID=$(id -g)` instructs the startup script to switch
148152
the user ID and the primary group ID of `${NB_USER}` to the user and group ID of
@@ -163,7 +167,7 @@ The server logs appear in the terminal.
163167
docker run -it --rm \
164168
--gpus '"device=all"' \
165169
-p 8888:8888 \
166-
-v "${PWD}":/home/jovyan \
170+
-v "${PWD}/jupyterlab-jovyan":/home/jovyan \
167171
IMAGE[:MAJOR[.MINOR[.PATCH]]]
168172
```
169173

README.md

+10-6
Original file line numberDiff line numberDiff line change
@@ -120,21 +120,25 @@ Create an empty directory:
120120
```bash
121121
mkdir jupyterlab-jovyan
122122
sudo chown 1000:100 jupyterlab-jovyan
123-
cd jupyterlab-jovyan
124123
```
125124

126125
It will be *bind mounted* as the JupyterLab user's home directory and
127126
automatically populated on first run.
128127

129128
### Run container
130129

130+
| :exclamation: Always mount the user's **entire** home directory.<br>Mounting a subfolder prevents the container from starting.[^1] |
131+
|------------------------------------------------------------------------------------------------------------------------------------|
132+
133+
[^1]: The only exception is the use case described at [Jupyter Docker Stacks > Quick Start > Example 2](https://github.com/jupyter/docker-stacks#quick-start).
134+
131135
self built:
132136

133137
```bash
134138
docker run -it --rm \
135139
-p 8888:8888 \
136140
-u root \
137-
-v "${PWD}":/home/jovyan \
141+
-v "${PWD}/jupyterlab-jovyan":/home/jovyan \
138142
-e NB_UID=$(id -u) \
139143
-e NB_GID=$(id -g) \
140144
-e CHOWN_HOME=yes \
@@ -148,7 +152,7 @@ from the project's GitLab Container Registries:
148152
docker run -it --rm \
149153
-p 8888:8888 \
150154
-u root \
151-
-v "${PWD}":/home/jovyan \
155+
-v "${PWD}/jupyterlab-jovyan":/home/jovyan \
152156
-e NB_UID=$(id -u) \
153157
-e NB_GID=$(id -g) \
154158
-e CHOWN_HOME=yes \
@@ -161,8 +165,8 @@ docker run -it --rm \
161165
* [`glcr.b-data.ch/jupyterlab/python/base`](https://gitlab.b-data.ch/jupyterlab/python/base/container_registry)
162166
* [`glcr.b-data.ch/jupyterlab/python/scipy`](https://gitlab.b-data.ch/jupyterlab/python/scipy/container_registry)
163167
164-
The use of the `-v` flag in the command mounts the current working directory on
165-
the host (`${PWD}` in the command) as `/home/jovyan` in the container.
168+
The use of the `-v` flag in the command mounts the empty directory on the host
169+
(`${PWD}/jupyterlab-jovyan` in the command) as `/home/jovyan` in the container.
166170
167171
`-e NB_UID=$(id -u) -e NB_GID=$(id -g)` instructs the startup script to switch
168172
the user ID and the primary group ID of `${NB_USER}` to the user and group ID of
@@ -182,7 +186,7 @@ The server logs appear in the terminal.
182186
```bash
183187
docker run -it --rm \
184188
-p 8888:8888 \
185-
-v "${PWD}":/home/jovyan \
189+
-v "${PWD}/jupyterlab-jovyan":/home/jovyan \
186190
IMAGE[:MAJOR[.MINOR[.PATCH]]]
187191
```
188192

0 commit comments

Comments
 (0)