Skip to content

Commit

Permalink
fix: jupyter user permission
Browse files Browse the repository at this point in the history
  • Loading branch information
spool committed Dec 11, 2023
1 parent c7ff9ac commit 3ffaced
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions compose/jupyter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down

0 comments on commit 3ffaced

Please sign in to comment.