Update R-base R version

Hi,

Would it be possible to update docker image openanalytics/r-base with the most recent version of R?

Many thanks in advance!

1 Like

Hi there,
You can actually build your own, following the approach shown at https://github.com/openanalytics/r-base

Essentially, build the R base image first using the Dockerfile, as you would with any other Dockerfile, but edit the deb address:

RUN echo "deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/" > /etc/apt/sources.list.d/cran.list

(I use Ubuntu: https://cran.r-project.org/bin/linux/ubuntu/README.html)

and the environment and label…

ENV R_BASE_VERSION 4.0.0
LABEL version=4.0.0

Name the Dockerfile (e.g. r/base40) and store in an appropriate location when you build it, then you can build your own image, by changing the FROM line… for example…

FROM r/base40

Hope this helps. I’m no expert at Docker, but this worked for me.

Will

Hey Will,

Thanks for your reply. This is more or less what I’ve also done in the end.
But still it would be great if openanalytics could update it because their templates are based on the old image and some packages could no longer be installed because of outdated version of R.

Yep, I definitely agree it would be great to get everything updated more regularly. I rely on Open Analytics ShinyProxy!

@klm @WillP

A new version of openanalytics/r-base(R 4.0.2) is now available on Docker Hub (based on this Github repo).

Thanks for the suggestion!

Best,
Tobias

For posterity, I found out that you can use the rocker-versioned2 docker images (https://github.com/rocker-org/rocker-versioned2) together with Shinyproxy. This gives two great features:

  1. You can use their Rstudio Server image for development and then use the same image in production (i.e. the Shiny app delivered via Shinyproxy uses the same libraries and R installation etc.), thereby reducing build complexity and space requirements.
  2. The Rocker images have a much bigger user base than Shinyproxy, so their dependencies (i.e. the stuff installed in bash) are much more reliable than the Shinyproxy base image. As a random example, the package devEMF wasn’t working for me in Shinyproxy’s 4.0.2 base image, but worked fine with the Rocker 4.0.2 image.

One thing to note, however, is that the R installation is in a different path, so you have to copy the Rprofile.site file a different place:
COPY Rprofile.site /usr/local/lib/R/etc/

Also, if you use your docker image for development, as I do, then you want to comment out the CMD command: #CMD [“R”, “-e”, “shiny::runApp(’/root/app’)”] (this line seems unnecessary even if you are using the standard Shinyproxy image)