[R-sig-Debian] Issues with Ubuntu 22.04 and Installing the Latest Version of R (R 4.4.1) to Docker Image
Dirk Eddelbuettel
edd @end|ng |rom deb|@n@org
Wed Jul 10 18:09:23 CEST 2024
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
More information about the R-SIG-Debian
mailing list