diff --git a/ci/arcgis/Dockerfile b/ci/arcgis/Dockerfile index 5c9da11..5a01095 100644 --- a/ci/arcgis/Dockerfile +++ b/ci/arcgis/Dockerfile @@ -4,3 +4,17 @@ RUN mamba install --yes 'jupyter-server-proxy' && \ mamba clean --all -f -y && \ fix-permissions "${CONDA_DIR}" && \ fix-permissions "/home/${NB_USER}" + +# Note: uncommenting this section makes "${env_name}" default both for Jupyter Notebook and Terminals +# More information here: https://github.com/jupyter/docker-stacks/pull/2047 +ARG env_name=base +USER root +RUN \ + # This changes a startup hook, which will activate the custom environment for the process + echo conda activate "${env_name}" >> /usr/local/bin/before-notebook.d/10activate-conda-env.sh && \ + # This makes the custom environment default in Jupyter Terminals for all users which might be created later + echo conda activate "${env_name}" >> /etc/skel/.bashrc && \ + # This makes the custom environment default in Jupyter Terminals for already existing NB_USER + echo conda activate "${env_name}" >> "/home/${NB_USER}/.bashrc" + +USER ${NB_UID}