-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
38 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,6 @@ | ||
#FROM ghcr.io/esri/arcgis-python-api-notebook | ||
FROM quay.io/jupyter/base-notebook:latest | ||
FROM ghcr.io/esri/arcgis-python-api-notebook | ||
|
||
RUN mamba install --yes 'jupyter-server-proxy' && \ | ||
mamba clean --all -f -y && \ | ||
fix-permissions "${CONDA_DIR}" && \ | ||
fix-permissions "/home/${NB_USER}" | ||
|
||
# Name your environment and choose the Python version | ||
ARG env_name=python310 | ||
ARG py_ver=3.10 | ||
|
||
# You can add additional libraries here | ||
RUN mamba create --yes -p "${CONDA_DIR}/envs/${env_name}" \ | ||
python=${py_ver} \ | ||
'ipykernel' \ | ||
'jupyterlab' \ | ||
'jupyter-server-proxy' && \ | ||
mamba clean --all -f -y | ||
|
||
# Create Python kernel and link it to jupyter | ||
RUN "${CONDA_DIR}/envs/${env_name}/bin/python" -m ipykernel install --user --name="${env_name}" && \ | ||
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 | ||
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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
FROM ghcr.io/esri/arcgis-python-api-notebook | ||
#FROM quay.io/jupyter/base-notebook:latest | ||
|
||
RUN mamba install --yes 'jupyter-server-proxy' && \ | ||
mamba clean --all -f -y && \ | ||
fix-permissions "${CONDA_DIR}" && \ | ||
fix-permissions "/home/${NB_USER}" | ||
|
||
# Name your environment and choose the Python version | ||
ARG env_name=python310 | ||
ARG py_ver=3.10 | ||
|
||
# You can add additional libraries here | ||
RUN mamba create --yes -p "${CONDA_DIR}/envs/${env_name}" \ | ||
python=${py_ver} \ | ||
'ipykernel' \ | ||
'jupyterlab' \ | ||
'jupyter-server-proxy' && \ | ||
mamba clean --all -f -y | ||
|
||
# Create Python kernel and link it to jupyter | ||
RUN "${CONDA_DIR}/envs/${env_name}/bin/python" -m ipykernel install --user --name="${env_name}" && \ | ||
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 | ||
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} |