R version in Docker image

I created a Singularity image from the Docker Hub CMake image using

$ singularity build afni-21.1.03.sif docker://afn/afni_cmake_build:AFNI_21.1.03

When I run it, I get

$ singularity shell afni-21.1.03.sif
Singularity> R --version
R version 3.4.4 (2018-03-15) -- "Someone to Lean On"

I was wondering whether there is a container image that uses an more up to date version of R, which just released 4.1 recently.

Thank you,

– bennet

Hi Bennet,

The AFNI Docker image is based on neurodebian 18.04 (which is based on ubuntu 18.04). R is installed using apt-get install r-base, and that installs 3.4.4 as you see. On the Ubuntu 18.04 website for r-base, you can see that 3.4.4 is the R version that is installed on ubuntu 18.04.

The easiest way to install a different R version would be to use a different base image. Specifically, you can use a more recent neurodebian version, like nd21.04. That will install R version 4.0.4, as you can see here. This will require rebuilding the AFNI docker image.


Thanks. Yes, I figured that it was being installed from the base image. It is just a bit ironic after

Purpose: Step 1 of setting up modern R from scratch.


in the installation instructions to get such an old R.

Just wanted to make sure R was not doing anything critical that depended on updates to R.

I haven’t tried updating R on Docker; there have been times where updating it has been difficult, esp. on WSL’s Ubuntu 18.04, as you can see from this thread: