|
| 1 | +FROM quay.io/jupyter/datascience-notebook:r-4.3.3 |
| 2 | + |
| 3 | +USER root |
| 4 | + |
| 5 | +### RStudio system dependencies |
| 6 | +RUN apt-get update && \ |
| 7 | + apt-get install -y --no-install-recommends \ |
| 8 | + lmodern psmisc lsb-release libssl-dev \ |
| 9 | + libclang-dev libpq5 libtiff-dev \ |
| 10 | + && \ |
| 11 | + apt-get clean -y && \ |
| 12 | + rm -rf /var/lib/apt/lists/* /tmp/library-scripts |
| 13 | + |
| 14 | +### RStudio server |
| 15 | +ARG RSTUDIO_VER=2023.12.1-402 |
| 16 | +ARG RSTUDIO_URL=https://download2.rstudio.org/server/jammy/amd64 |
| 17 | +RUN wget -q ${RSTUDIO_URL}/rstudio-server-${RSTUDIO_VER}-amd64.deb && \ |
| 18 | + apt-get install -yq --no-install-recommends ./rstudio*.deb && \ |
| 19 | + rm -f ./rstudio*.deb && \ |
| 20 | + apt-get clean && \ |
| 21 | + chmod 777 /var/run/rstudio-server && \ |
| 22 | + chmod +t /var/run/rstudio-server |
| 23 | + |
| 24 | +USER ${NB_USER} |
| 25 | + |
| 26 | +### RStudio launch button in JupyterLab |
| 27 | +RUN mamba install -y -c conda-forge --freeze-installed \ |
| 28 | + jupyter-rsession-proxy=2.2.0 && \ |
| 29 | + mamba clean --all |
| 30 | + |
| 31 | +### Enhanced R terminal |
| 32 | +RUN pip install \ |
| 33 | + radian==0.6.11 |
| 34 | + |
| 35 | +### Additional editing and debugging tools for VS Code R development |
| 36 | +RUN R -q -e 'remotes::install_version("markdown", version="1.12", repos="cloud.r-project.org")' && \ |
| 37 | + R -q -e 'remotes::install_version("languageserver", version="0.3.16", repos="cloud.r-project.org")' && \ |
| 38 | + R -q -e 'remotes::install_version("httpgd", version="2.0.1", repos="cloud.r-project.org")' && \ |
| 39 | + R -q -e 'remotes::install_github("ManuelHentschel/vscDebugger")' && \ |
| 40 | + echo |
| 41 | + |
| 42 | +### Prints Jupyter server token when terminal is opened |
| 43 | +RUN echo "echo \"Jupyter server token: \$(jupyter server list 2>&1 | grep -oP '(?<=token=)[[:alnum:]]*')\"" > ${HOME}/.get-token.sh && \ |
| 44 | + echo "sh \${HOME}/.get-token.sh" >> ${HOME}/.bashrc |
0 commit comments