2022-03-25 10:07:59 +01:00
FROM rocker/r-ver:4.1.3
LABEL org.opencontainers.image.licenses= "GPL-2.0-or-later" \
org.opencontainers.image.source= "https://github.com/rocker-org/rocker-versioned2" \
org.opencontainers.image.vendor= "Rocker Project" \
org.opencontainers.image.authors= "Carl Boettiger <cboettig@ropensci.org>"
ENV S6_VERSION = v2.1.0.2
ENV RSTUDIO_VERSION = 2022 .02.1+461
ENV DEFAULT_USER = rstudio
ENV PANDOC_VERSION = default
ENV PATH = /usr/lib/rstudio-server/bin:$PATH
2022-03-29 12:43:39 +02:00
# Install OpenJDK
RUN apt-get update && apt-get install -y openjdk-8-jdk-headless openjdk-8-jre-headless
2022-03-29 16:23:39 +02:00
# Some R dependencies
RUN apt-get update && apt-get install -y \
libxml2 \
git \
gdal-bin \
netcdf-bin \
sshpass \
p7zip-full \
sox \
imagemagick \
proj-bin \
proj-data \
libgsl23 \
2022-03-29 17:04:30 +02:00
postgresql-server-dev-all \
libsecret-1-0
2022-03-29 16:23:39 +02:00
# Install the R packages we need, using the binary distribution
# at https://packagemanager.rstudio.com/client/#/repos/1/overview
2022-03-29 12:43:39 +02:00
ADD https://code-repo.d4science.org/gCubeSystem/r-packages-list/raw/branch/master/install2r-packages.txt /tmp
RUN for f in ` cat /tmp/install2r-packages.txt` ; do install2.r --error --skipinstalled --ncpus -1 $f ; done
# Non CRAN repositories
ADD https://code-repo.d4science.org/gCubeSystem/r-packages-list/raw/branch/master/r_non_cran_pkgs.txt /tmp
RUN for l in ` cat /tmp/r_non_cran_pkgs.txt` ; do \
pkg = ` echo $l | cut -d : -f 1` ; \
mirror = ` echo $l | cut -d : -f 2-` ; \
Rscript --slave --no-site-file --no-init-file --no-save --no-restore-history \
-e " install.packages(pkgs=' $pkg ', repos=c(' $mirror /')); " ; done
# From github
ADD https://code-repo.d4science.org/gCubeSystem/r-packages-list/raw/branch/master/r_github_pkgs.txt /tmp
2022-03-29 18:21:56 +02:00
#RUN mkdir -p /etc/R
#RUN echo "GITHUB_PAT=$GITHUB_PAT" >> /etc/R/Renviron.site
2022-03-29 15:14:41 +02:00
#RUN for g in `cat /tmp/r_github_pkgs.txt` ; do \
# Rscript --slave --no-site-file --no-init-file --no-save --no-restore-history \
# -e " require(devtools); devtools::install_github('$g')" ; done
2022-03-29 18:21:56 +02:00
#RUN for g in `cat /tmp/r_github_pkgs.txt` ; do installGithub.r -d TRUE -u FALSE -r https://packagemanager.rstudio.com/all/__linux__/focal/latest $g ; done
#RUN grep -v "GITHUB_PATH" /etc/R/Renviron.site > /etc/R/Renviron.site.1
#RUN mv -f /etc/R/Renviron.site.1 /etc/R/Renviron.site
2022-03-29 20:01:36 +02:00
RUN installGithub.r -d TRUE -u FALSE -r https://packagemanager.rstudio.com/all/__linux__/focal/latest DanOvando/sraplus
2022-03-29 17:04:30 +02:00
# Ensure that we remove the source packages
RUN rm -fr /tmp/downloaded_packages/*
2022-03-29 12:43:39 +02:00
2022-03-25 10:07:59 +01:00
RUN /rocker_scripts/install_rstudio.sh
RUN /rocker_scripts/install_pandoc.sh
2022-03-29 19:59:47 +02:00
# Add the mountpoint for the workspace
2022-03-29 15:14:41 +02:00
RUN mkdir /workspace
2022-03-29 12:43:39 +02:00
# This part comes from https://github.com/openanalytics/shinyproxy-rstudio-ide-demo/blob/master/Dockerfile
2022-03-30 11:26:20 +02:00
RUN echo "www-frame-origin=same" >> /etc/rstudio/disable_auth_rserver.conf
2022-03-29 12:43:39 +02:00
RUN echo "www-verify-user-agent=0" >> /etc/rstudio/disable_auth_rserver.conf
ADD 03_setup_root_path.sh /etc/cont-init.d/03_setup_root_path.sh
# By default RStudio does not give access to all enviornment variables defined in the container (e.g. using ShinyProxy).
# Uncomment the next line, to change this behavior.
ADD 04_copy_env.sh /etc/cont-init.d/04_copy_env.sh
ADD 05_setup_rsession_parameters.sh /etc/cont-init.d/05_setup_rsession_parameters.sh
2022-03-25 10:07:59 +01:00
EXPOSE 8787
2022-03-29 12:43:39 +02:00
CMD [ "/init" ]