From 3ffacedc82a3adaf77ef0ce677ff49fdec6fc01a Mon Sep 17 00:00:00 2001 From: Dr Griffith Rees Date: Mon, 11 Dec 2023 09:02:40 +0000 Subject: [PATCH] fix: `jupyter` `user` permission --- compose/jupyter/Dockerfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/compose/jupyter/Dockerfile b/compose/jupyter/Dockerfile index 07fe785a..cd8ebbaf 100644 --- a/compose/jupyter/Dockerfile +++ b/compose/jupyter/Dockerfile @@ -63,18 +63,20 @@ RUN "${CONDA_DIR}/envs/${env_name}/bin/python" -m ipykernel install --user --nam fix-permissions "/home/${NB_USER}" # Copy the rest of the clim-recal code to volume -ADD --chown=${NB_UID}:${NB_GID} . . +COPY --chown=${NB_UID}:${NB_GID} . . +# Switch to default jupyter user +USER ${NB_UID} # Add custom activate script to reflect environment -USER root +# USER root RUN activate_custom_env_script=/usr/local/bin/before-notebook.d/activate_custom_env.sh && \ echo "#!/bin/bash" > ${activate_custom_env_script} && \ echo "eval \"$(conda shell.bash activate "${env_name}")\"" >> ${activate_custom_env_script} && \ chmod +x ${activate_custom_env_script} # Switch to default jupyter user -USER ${NB_UID} +# USER ${NB_UID} # This eases running shell commands outside docker following: # https://pythonspeed.com/articles/activate-conda-dockerfile/