diff --git a/lmod/Dockerfile b/lmod/Dockerfile index c0596a75db61a134a5550c0a872121af3a071272..1ccd60248c76b213d62a54e3fc3eea627ac40aa3 100644 --- a/lmod/Dockerfile +++ b/lmod/Dockerfile @@ -1,4 +1,5 @@ -ARG ROOT_CONTAINER=rockylinux:8.8.20230518 +ARG ROOT_CONTAINER=rockylinux/rockylinux:9.4.20240523-ubi +# ARG ROOT_CONTAINER=rockylinux:8.8.20230518 ARG BASE_CONTAINER=$ROOT_CONTAINER FROM $BASE_CONTAINER @@ -58,3 +59,4 @@ RUN /bin/bash /tmp/mnt.sh && rm /tmp/mnt.sh && fix-permissions /tmp/custom USER $NB_USER WORKDIR /home/$NB_USER ENTRYPOINT ["/bin/bash", "/tmp/custom/start_jupyter.sh"] +CMD ["--ServerApp.default_url=/lab/tree/home/jovyan"] diff --git a/lmod/files/start_jupyter.sh b/lmod/files/start_jupyter.sh index 592cb295d091ca173048a3dc4e9556647a6bc40e..456312c5fd01f0c20c8994b4074b76806b416c80 100644 --- a/lmod/files/start_jupyter.sh +++ b/lmod/files/start_jupyter.sh @@ -137,6 +137,14 @@ cleanup () { } update_config () { + if [[ -f ${DIR}/config.py ]]; then + sed -i -e "s|_servername_|${JUPYTERHUB_SERVER_NAME}|g" ${DIR}/config.py + else + # Otherwise the CMD in Dockerfile would not work correctly + # If other values are required, one can add a default config.py, this is + # just the fallback solution + echo "c.ServerApp.root_dir = \"/\"" >> ${DIR}/config.py + fi if [[ -f ${EBROOTJUPYTERLAB}/etc/jupyter/jupyter_notebook_config.py ]]; then echo "$(date) - Add system specific config ..." echo "" >> ${DIR}/config.py @@ -155,7 +163,7 @@ update_config () { start () { echo "$(date) - Start jupyterhub-singleuser ..." - jupyterhub-singleuser --config ${DIR}/config.py 2>&1 | tee ${JUPYTER_LOG_DIR}/stdout + jupyterhub-singleuser --config ${DIR}/config.py ${@} 2>&1 | tee ${JUPYTER_LOG_DIR}/stdout echo "$(date) - Start jupyterhub-singleuser done" }