[R-sig-Debian] Issues with Ubuntu 22.04 and Installing the Latest Version of R (R 4.4.1) to Docker Image

Gerber, Lauren J |@uren@gerber @end|ng |rom he|@|nk|@||
Wed Jul 10 18:43:15 CEST 2024


Hi Dirk,

Thank you so much for looking into this when you got home. I greatly appreciate it.

I was actually in the midst of writing to everyone the following message:
….
….
….

Hi All,

I have some good news. 😊 My docker image is now up-to-date with R version 4.4.1.

I first had to clear a bunch of unused data using docker system prune –force. Apparently, it cleared over 32.53 gigs of data, and seemed to have been interfering with some of the package installations trying to take place.

Next, I tried using part of Marco’s dockerfile and it helped solve the issue:

RUN apt-get update \
      && apt install -y \
      software-properties-common \
      dirmngr \
      gnupg2 \
      wget \
      build-essential \
      libcurl4-openssl-dev \
      libxml2-dev \
      libasound2 \
      python3 \
      python3-pip \
      python3.10-venv \
      git-all \
      lsb-release \
      libxml-twig-perl \
      libc6-dev \
      && wget -q -O - https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc \
      | tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc  \
&& add-apt-repository -y "ppa:marutter/rrutter4.0"

 RUN apt-get update -y \
     && apt-get install -y r-base\
     && apt-get clean \
     && apt-get purge \
     && rm -rf /var/lib/apt/lists/* /tmp/*

Then I ran my Docker image in interactive mode to check it and it worked 😊:
/# apt-cache policy r-base-core
r-base-core:
  Installed: 4.4.1-1.2204.0
  Candidate: 4.4.1-1.2204.0
  Version table:
 *** 4.4.1-1.2204.0 100
        100 /var/lib/dpkg/status

This is great. Thank you all so much.

Br,
Lauren
--
Lauren J. Gerber
Bioinformatician
Precision Systems Medicine (Kallioniemi) Research Group
iCAN – Digital Precision Cancer Medicine Flagship
Institute for Molecular Medicine Finland (FIMM)
Nordic EMBL Partnership for Molecular Medicine
Biomedicum Helsinki 2U, D301a1
P.O. Box 20 (Tukholmankatu 8)
FI-00014 University of Helsinki, Finland
lauren.gerber using helsinki.fi

From: Dirk Eddelbuettel <edd using debian.org>
Date: Wednesday, 10. July 2024 at 19.09
To: Gerber, Lauren J <lauren.gerber using helsinki.fi>
Cc: Dirk Eddelbuettel <edd using debian.org>, marcoblanchette using icloud.com <marcoblanchette using icloud.com>, r-sig-debian using r-project.org <r-sig-debian using r-project.org>
Subject: Re: [R-sig-Debian] Issues with Ubuntu 22.04 and Installing the Latest Version of R (R 4.4.1) to Docker Image

Lauren,

I am now back home where looking into these things is a little easier. From
your first email to me, I started off with the selenium container you
mentioned as your starting point.

And that basically is your issue. It is a 'high-level' container, and it sets
a user. (Essentially) all other Dockerfiles you have seen and been pointed at
are 'lower-level' and operate as root -- so you need to inject 'sudo' calls.
Otherwise it really is 'just' getting one key and adding one repo, but it
helps to have had the same user <-> root issues before ...

So below is a working 'minimal' Dockerfile that gets me R 4.4.1 (validated
via 'docker exec -ti container_id_here bash' once built). Hope it helps.

Best,  Dirk



FROM selenium/standalone-firefox:latest

## Following the standard rocker/r2u:jammy Dockerfile, and adapted slightly

RUN sudo apt update \
##
## We would normally do
##   apt install --yes --no-install-recommends ca-certificates locales wget
## but these are already installed
##
## So we skip to the next step of adding the key and repo
   && wget -q -O - https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc \
           | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc  \
   && echo "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/cran_ubuntu_key.asc] https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/" \
           | sudo tee -a /etc/apt/sources.list.d/cran.list \
##
## Update again and install R
   && sudo apt update -qqq \
   && sudo apt install --yes --no-install-recommends r-base-core


--
dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org

	[[alternative HTML version deleted]]



More information about the R-SIG-Debian mailing list