-
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
10 changed files
with
252 additions
and
102 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
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
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
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,13 @@ | ||
#FROM openscapes/rocker:a7596b5 | ||
FROM eeholmes/py-rocket:20231004 | ||
|
||
RUN pip3 install \ | ||
'jupyter-rsession-proxy' \ | ||
'jupyterhub==3.1.*' \ | ||
'notebook==6.*' \ | ||
'jupyterlab' | ||
|
||
#RUN R --quiet -e 'remotes::install_github("IRkernel/IRkernel@*release")' | ||
#RUN R --quiet -e 'IRkernel::installspec(user = FALSE)' | ||
|
||
CMD ["jupyterhub-singleuser"] |
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,75 @@ | ||
FROM rocker/geospatial:4.2 | ||
|
||
ENV CONDA_ENV=notebook \ | ||
DEBIAN_FRONTEND=noninteractive \ | ||
NB_USER=rstudio \ | ||
SHELL=/bin/bash \ | ||
# Setup locale to be UTF-8, avoiding gnarly hard to debug encoding errors | ||
LANG=C.UTF-8 \ | ||
LC_ALL=C.UTF-8 \ | ||
CONDA_DIR=/srv/conda | ||
|
||
# All env vars that reference other env vars need to be in their own ENV block | ||
# Path to the python environment where the jupyter notebook packages are installed | ||
ENV NB_PYTHON_PREFIX=${CONDA_DIR}/envs/${CONDA_ENV} \ | ||
# Home directory of our non-root user | ||
HOME=/home/${NB_USER} | ||
|
||
# Add both our notebook env as well as default conda installation to $PATH | ||
# Thus, when we start a `python` process (for kernels, or notebooks, etc), | ||
# it loads the python in the notebook conda environment, as that comes | ||
# first here. | ||
ENV PATH=${NB_PYTHON_PREFIX}/bin:${CONDA_DIR}/bin:${PATH} | ||
|
||
# Ask dask to read config from ${CONDA_DIR}/etc rather than | ||
# the default of /etc, since the non-root jovyan user can write | ||
# to ${CONDA_DIR}/etc but not to /etc | ||
ENV DASK_ROOT_CONFIG=${CONDA_DIR}/etc | ||
|
||
RUN usermod -aG sudo ${NB_USER} && chown -R ${NB_USER}:${NB_USER} /srv | ||
RUN usermod -d /home/jovyan rstudio | ||
|
||
# bin to PATH earlier ($NB_PYTHON_PREFIX/bin) | ||
RUN echo ". ${CONDA_DIR}/etc/profile.d/conda.sh ; conda activate ${CONDA_ENV}" > /etc/profile.d/init_conda.sh | ||
|
||
USER ${NB_USER} | ||
|
||
COPY --chown=rstudio:rstudio . /tmp/build | ||
|
||
WORKDIR /tmp/build | ||
|
||
# Install latest mambaforge in ${CONDA_DIR} | ||
RUN echo "Installing Mambaforge..." \ | ||
&& URL="https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh" \ | ||
&& wget --quiet ${URL} -O installer.sh \ | ||
&& /bin/bash installer.sh -u -b -p ${CONDA_DIR} \ | ||
&& rm installer.sh \ | ||
&& mamba clean -afy \ | ||
# After installing the packages, we cleanup some unnecessary files | ||
# to try reduce image size - see https://jcristharif.com/conda-docker-tips.html | ||
&& find ${CONDA_DIR} -follow -type f -name '*.a' -delete \ | ||
&& find ${CONDA_DIR} -follow -type f -name '*.pyc' -delete | ||
|
||
RUN echo "Checking for 'conda-linux-64.lock' or 'environment.yml'..." \ | ||
; if test -f "conda-linux-64.lock" ; then \ | ||
mamba create --name ${CONDA_ENV} --file conda-linux-64.lock \ | ||
; elif test -f "environment.yml" ; then \ | ||
mamba env create --name ${CONDA_ENV} -f environment.yml \ | ||
; else echo "No conda-linux-64.lock or environment.yml! *creating default env*" ; \ | ||
mamba create --name ${CONDA_ENV} pangeo-notebook \ | ||
; fi \ | ||
&& mamba clean -yaf \ | ||
&& find ${CONDA_DIR} -follow -type f -name '*.a' -delete \ | ||
&& find ${CONDA_DIR} -follow -type f -name '*.pyc' -delete \ | ||
&& find ${CONDA_DIR} -follow -type f -name '*.js.map' -delete \ | ||
; if [ -d ${NB_PYTHON_PREFIX}/lib/python*/site-packages/bokeh/server/static ]; then \ | ||
find ${NB_PYTHON_PREFIX}/lib/python*/site-packages/bokeh/server/static -follow -type f -name '*.js' ! -name '*.min.js' -delete \ | ||
; fi | ||
|
||
RUN pip install jupyter-rsession-proxy | ||
|
||
WORKDIR ${HOME} | ||
|
||
EXPOSE 8888 | ||
|
||
CMD ["jupyter", "lab", "--ip=0.0.0.0", "--port=8888", "--allow-root", "--no-browser"] |
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,9 @@ | ||
FROM rocker/binder:4.3 | ||
|
||
RUN pip3 install \ | ||
'jupyter-rsession-proxy' \ | ||
'jupyterhub==3.1.*' \ | ||
'notebook==6.*' \ | ||
'jupyterlab' | ||
|
||
CMD ["jupyterhub-singleuser"] |
Oops, something went wrong.