@@ -44,6 +44,9 @@ image containing useful tools and libraries for data science, complete these ste
44
44
# https://github.com/jupyter/docker-stacks/tree/HEAD/datascience-notebook/Dockerfile
45
45
name : jupyter/datascience-notebook
46
46
tag : latest
47
+ # `cmd: null` allows the custom CMD of the Jupyter docker-stacks to be used
48
+ # which performs further customization on startup.
49
+ cmd : null
47
50
` ` `
48
51
49
52
` ` ` {note}
@@ -244,10 +247,9 @@ FROM jupyter/minimal-notebook:latest
244
247
RUN pip install --no-cache-dir astropy
245
248
246
249
# set the default command of the image,
247
- # if the parent image will not launch a jupyterhub singleuser server.
248
- # The JupyterHub "Docker stacks" do not need to be overridden.
249
- # Set either here or in `singleuser.cmd` in your values.yaml
250
- # CMD ["jupyterhub-singleuser"]
250
+ # if you want to launch more complex startup than the default `juptyerhub-singleuser`.
251
+ # To launch an image's custom CMD instead of the default `jupyterhub-singleuser`
252
+ # set `singleuser.cmd: null` in your config.yaml.
251
253
```
252
254
253
255
``` {note}
@@ -529,25 +531,33 @@ this is best done in the ENTRYPOINT of the image,
529
531
and not in the CMD, so that overriding the command does not skip your preparation.
530
532
```
531
533
532
- By default, zero-to-jupyterhub will launch the default CMD that is specified in your chosen image,
533
- respecting any startup customization that image may have.
534
- If the image doesn't launch ` jupyterhub-singleuser ` by default,
535
- you will additionally need to specify ` singleuser.cmd `
536
- in your ` values.yaml ` as the command to launch,
537
- so that it ultimately launches ` jupyterhub-singleuser ` .
538
- The simplest version:
534
+ By default, zero-to-jupyterhub will launch the command ` jupyterhub-singleuser ` .
535
+ If you have an image (such as ` jupyter/scipy-notebook ` and other Jupyter Docker stacks)
536
+ that defines a CMD with startup customization and ultimately launches ` jupyterhub-singleuser ` ,
537
+ you can chose to launch the image's default CMD instead by setting:
539
538
540
539
``` yaml
541
540
singleuser :
542
- cmd : jupyterhub-singleuser
541
+ cmd : null
543
542
` ` `
544
543
545
- ` ` ` {versionchanged} 2.0
546
- Prior to 2.0, the default behavior of zero-to-jupyterhub was to launch `jupyterhub-singleuser` explicitly,
547
- ignoring what was in the image.
548
- The default command is now whatever the image runs by default.
544
+ Alternately, you can specify an explicit custom command as a string or list of strings:
545
+
546
+ ` ` ` yaml
547
+ singleuser :
548
+ cmd :
549
+ - /usr/local/bin/custom-command
550
+ - " --flag"
551
+ - " --other-flag"
549
552
` ` `
550
553
554
+ :::{note}
555
+ Docker has ` ENTRYPOINT` and `CMD`,
556
+ which k8s calls `command` and `args`.
557
+ zero-to-jupyterhub always respects the ENTRYPOINT of the image,
558
+ and setting `singleuser.cmd` only overrides the CMD.
559
+ :: :
560
+
551
561
# # Disable specific JupyterLab extensions
552
562
553
563
Sometimes you want to temporarily disable a JupyterLab extension on a JupyterHub
0 commit comments