Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions ruser/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM docker.io/ubuntu:focal-20210921

ENV DEBIAN_FRONTEND=noninteractive

COPY install_r_deps.sh /tmp/
RUN /tmp/install_r_deps.sh

COPY install_r.sh /tmp/
RUN /tmp/install_r.sh

# SPM site-wide (???)
RUN sed -i 's/cloud\.r-project\.org/packagemanager\.rstudio\.com\/all\/latest/g' /usr/lib/R/etc/Rprofile.site

# original reference: https://github.com/pachadotdev/rstudio-server-droplet
COPY install_rstudio.sh /tmp/
RUN /tmp/install_rstudio.sh

COPY install_rshiny.sh /tmp/
RUN /tmp/install_rshiny.sh

COPY install_r_pkgs.sh /tmp/
RUN /tmp/install_r_pkgs.sh

CMD rstudio-server start && shiny-server
10 changes: 10 additions & 0 deletions ruser/install_r.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/sh
apt-get -yqq update

# install R
apt-get -y install r-base r-base-dev
R CMD javareconf

apt-get -qq purge
apt-get -qq clean
rm -rf /var/lib/apt/lists/*
42 changes: 42 additions & 0 deletions ruser/install_r_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/sh
apt-get -yqq update
apt-get -yqq install gnupg2 ca-certificates

# add CRAN to apt sources
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
printf '\n#CRAN mirror\ndeb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/\n' | tee -a /etc/apt/sources.list

# update apt
apt-get -y update
apt-get -y upgrade

# requisites for RStudio
apt-get -y install gdebi-core

# requisites for different R packages
# this aims at covering as much packages as possible
# see https://packagemanager.rstudio.com/client/#/repos/1/overview
# and also
# https://geocompr.github.io/post/2020/installing-r-spatial-ubuntu/
# http://dirk.eddelbuettel.com/blog/2020/06/22#027_ubuntu_binaries
# this a broad, general setup, no fine detail here
apt-get -y install software-properties-common libopenblas-dev libsodium-dev texlive default-jdk

# saw error about this during install - MP
# this is for pkgdown
apt-get -y install \
libharfbuzz-dev \
libfribidi-dev \
libfreetype6-dev \
libpng-dev \
libtiff5-dev \
libjpeg-dev

# required to install rshiny / rstudio:
apt-get install wget

add-apt-repository -y ppa:c2d4u.team/c2d4u4.0+

apt-get -qq purge
apt-get -qq clean
rm -rf /var/lib/apt/lists/*
36 changes: 36 additions & 0 deletions ruser/install_r_final.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apt-get -yqq update
apt-get -yqq install gnupg2 ca-certificates

# add CRAN to apt sources
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
printf '\n#CRAN mirror\ndeb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/\n' | tee -a /etc/apt/sources.list

# update apt
apt-get -y update
apt-get -y upgrade

# requisites for RStudio
apt-get -y install gdebi-core

# requisites for different R packages
# this aims at covering as much packages as possible
# see https://packagemanager.rstudio.com/client/#/repos/1/overview
# and also
# https://geocompr.github.io/post/2020/installing-r-spatial-ubuntu/
# http://dirk.eddelbuettel.com/blog/2020/06/22#027_ubuntu_binaries
# this a broad, general setup, no fine detail here
apt-get -y install software-properties-common libopenblas-dev libsodium-dev texlive default-jdk

# saw error about this
apt-get -y install libharfbuzz-dev libfribidi-dev

add-apt-repository -y ppa:c2d4u.team/c2d4u4.0+
apt-get -y update

# install R
apt-get -y install r-base r-base-dev
R CMD javareconf

# SPM site-wide
sed -i 's/cloud\.r-project\.org/packagemanager\.rstudio\.com\/all\/latest/g' /usr/lib/R/etc/Rprofile.site

17 changes: 17 additions & 0 deletions ruser/install_r_pkgs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/sh
apt-get -y update

# install R packages
apt-get -y install r-cran-devtools r-cran-usethis r-cran-tidyverse r-cran-janitor r-cran-writexl r-cran-data.table r-cran-roxygen2 r-cran-knitr r-cran-rmarkdown r-cran-bookdown r-cran-xaringan r-cran-rdpack r-cran-dbi r-cran-dbplyr r-cran-rmariadb r-cran-rpostgres r-cran-glue r-cran-doparallel r-cran-future r-cran-shiny r-cran-shinyjs r-cran-shinydashboard r-cran-dt

R --vanilla << EOF
options(repos = c(REPO_NAME = "https://packagemanager.rstudio.com/all/latest"))
install.packages("tidymodels")
install.packages("pkgdown")
install.packages("highcharter")
q()
EOF

apt-get -qq purge
apt-get -qq clean
rm -rf /var/lib/apt/lists/*
5 changes: 5 additions & 0 deletions ruser/install_rshiny.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/sh
# install Shiny Server
wget https://download3.rstudio.org/ubuntu-14.04/x86_64/shiny-server-1.5.16.958-amd64.deb
gdebi --n shiny-server-1.5.16.958-amd64.deb
rm shiny-server-1.5.16.958-amd64.deb
12 changes: 12 additions & 0 deletions ruser/install_rstudio.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/sh
apt-get -yqq update

# install RStudio Server
wget https://download2.rstudio.org/server/bionic/amd64/rstudio-server-1.4.1106-amd64.deb
gdebi --n rstudio-server-1.4.1106-amd64.deb
rm rstudio-server-1.4.1106-amd64.deb
export LANG="en_US"

apt-get -qq purge
apt-get -qq clean
rm -rf /var/lib/apt/lists/*