diff --git a/Dockerfile b/Dockerfile index c5ea039..466bad3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,47 +1,7 @@ -FROM rocker/geospatial:4.3.1 +FROM rocker/binder:4.3.1 -# Install conda here, to match what repo2docker does -ENV CONDA_DIR=/srv/conda - -# Add our conda environment to PATH, so python, mamba and other tools are found in $PATH -ENV PATH ${CONDA_DIR}/bin:${PATH} - -# RStudio doesn't actually inherit the ENV set in Dockerfiles, so we -# have to explicitly set it in Renviron.site -RUN echo "PATH=${PATH}" >> /usr/local/lib/R/etc/Renviron.site - -# The terminal inside RStudio doesn't read from Renviron.site, but does read -# from /etc/profile - so we rexport here. -RUN echo "export PATH=${PATH}" >> /etc/profile - -# Install shiny-server -RUN /rocker_scripts/install_shiny_server.sh - -# Install a specific version of mambaforge in ${CONDA_DIR} -# Pick latest version from https://github.com/conda-forge/miniforge/releases -ENV MAMBAFORGE_VERSION=22.9.0-2 -RUN echo "Installing Mambaforge..." \ - && curl -sSL "https://github.com/conda-forge/miniforge/releases/download/${MAMBAFORGE_VERSION}/Mambaforge-${MAMBAFORGE_VERSION}-Linux-$(uname -m).sh" > 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 - -COPY environment.yml /tmp/environment.yml - -RUN mamba env update -p ${CONDA_DIR} -f /tmp/environment.yml \ - && mamba clean -afy \ - && find ${CONDA_DIR} -follow -type f -name '*.a' -delete \ - && find ${CONDA_DIR} -follow -type f -name '*.pyc' -delete - -# Install IRKernel -RUN install2.r --skipinstalled \ - IRkernel \ - rstan \ - && rm -rf /tmp/downloaded_packages +COPY requirements.txt /tmp/requirements.txt +RUN pip install --no-cache -r /tmp/requirements.txt # Install learnr and other requested packages in https://2i2c.freshdesk.com/a/tickets/741 # mosaic installed per https://2i2c.freshdesk.com/a/tickets/973 @@ -64,8 +24,6 @@ RUN install2.r --skipinstalled \ mosaic \ && rm -rf /tmp/downloaded_packages -RUN r -e "IRkernel::installspec(prefix='${CONDA_DIR}')" - # Set working directory so Jupyter knows where to start WORKDIR /home/rstudio diff --git a/environment.yml b/environment.yml deleted file mode 100644 index 61c5469..0000000 --- a/environment.yml +++ /dev/null @@ -1,23 +0,0 @@ -channels: - - conda-forge - - nodefaults - -dependencies: - # Required to work with JupyterHub - - jupyterhub-singleuser>=3.0 - # Required to work with RStudio - - jupyter-rsession-proxy>=2 - # Let's provide Jupyter Interfaces too - - jupyterlab>=3.0 - - retrolab - # Provide info on memory usage in JupyterLab & RetroLab - - jupyter-resource-usage - # People still wanna pull stuff, even if into RStudio - - nbgitpuller==1.1.1 - - - pip - - - pip: - - jupyter-shiny-proxy==1.1 - # Based on request from Nathan Taback - - otter-grader==4.3.4 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..2d54ab9 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,9 @@ +retrolab +# Provide info on memory usage in JupyterLab & RetroLab +jupyter-resource-usage +# People still wanna pull stuff, even if into RStudio +nbgitpuller==1.2.0 + +jupyter-shiny-proxy==1.1 +# Based on request from Nathan Taback +otter-grader==4.3.4