Skip to content
Snippets Groups Projects
Commit 11010fb3 authored by Tim Kreuzer's avatar Tim Kreuzer
Browse files

support arguments, use rootdir as default

parent 4423f668
No related branches found
No related tags found
1 merge request!2restructure User Images
Pipeline #230367 failed
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 ARG BASE_CONTAINER=$ROOT_CONTAINER
FROM $BASE_CONTAINER FROM $BASE_CONTAINER
...@@ -58,3 +59,4 @@ RUN /bin/bash /tmp/mnt.sh && rm /tmp/mnt.sh && fix-permissions /tmp/custom ...@@ -58,3 +59,4 @@ RUN /bin/bash /tmp/mnt.sh && rm /tmp/mnt.sh && fix-permissions /tmp/custom
USER $NB_USER USER $NB_USER
WORKDIR /home/$NB_USER WORKDIR /home/$NB_USER
ENTRYPOINT ["/bin/bash", "/tmp/custom/start_jupyter.sh"] ENTRYPOINT ["/bin/bash", "/tmp/custom/start_jupyter.sh"]
CMD ["--ServerApp.default_url=/lab/tree/home/jovyan"]
...@@ -137,6 +137,14 @@ cleanup () { ...@@ -137,6 +137,14 @@ cleanup () {
} }
update_config () { 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 if [[ -f ${EBROOTJUPYTERLAB}/etc/jupyter/jupyter_notebook_config.py ]]; then
echo "$(date) - Add system specific config ..." echo "$(date) - Add system specific config ..."
echo "" >> ${DIR}/config.py echo "" >> ${DIR}/config.py
...@@ -155,7 +163,7 @@ update_config () { ...@@ -155,7 +163,7 @@ update_config () {
start () { start () {
echo "$(date) - Start jupyterhub-singleuser ..." 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" echo "$(date) - Start jupyterhub-singleuser done"
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment