Skip to content

Commit a6646b8

Browse files
unkcpzdanielhollas
authored andcommitted
Using notebook CMD to run the jupyter stack (#331)
The new jupyter/minimal-notebook image uses lab CMD to run the jupyter server, which was introduced by jupyter/docker-stacks#1575. It provides DOCKER_STACKS_JUPYTER_CMD to set how to run it. The lab (full-stack) is for AiiDAlab only and should start with notebook mode. I pin it as an environment variable to start the jupyter backend. Since we have the new jupyterhub, the `NOTEBOOK_ARGS` can be used to set the notebook arguments.
1 parent 9a40121 commit a6646b8

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

stack/lab/Dockerfile

+10-6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ FROM base
33

44
LABEL maintainer="AiiDAlab Team <[email protected]>"
55

6+
# By default, Jupyter Docker image launches the JupyterLab interface.
7+
# Here, we change it to the classic Jupyter Notebook which is used by AiiDAlab.
8+
# In the future, we might want to switch to other options such as `nbclassic` or `retro`,
9+
# but the `nbclassic` is not supported because of appmode.
10+
# see: https://jupyter-docker-stacks.readthedocs.io/en/latest/using/common.html#switching-back-to-the-classic-notebook-or-using-a-different-startup-command
11+
ENV DOCKER_STACKS_JUPYTER_CMD=notebook
12+
613
USER root
714
WORKDIR /opt/
815

@@ -74,9 +81,6 @@ WORKDIR "/home/${NB_USER}"
7481

7582
RUN mkdir -p /home/${NB_USER}/apps
7683

77-
# Switch to NOTEBOOK_ARGS approach (see below)
78-
# for newer jupyter docker stack versions.
79-
RUN echo 'c.NotebookApp.default_url="/apps/apps/home/start.ipynb"' >> /etc/jupyter/jupyter_notebook_config.py
80-
# ENV NOTEBOOK_ARGS \
81-
# "--NotebookApp.default_url='/apps/apps/home/start.ipynb'" \
82-
# "--ContentsManager.allow_hidden=True"
84+
ENV NOTEBOOK_ARGS \
85+
"--NotebookApp.default_url='/apps/apps/home/start.ipynb'" \
86+
"--ContentsManager.allow_hidden=True"

0 commit comments

Comments
 (0)