Dirk, totally right! We used to be extremely sensitized about our hardware 
flavors 20 years ago! With the advent of cloud based computing (in my case AWS) 
and the migration of Macs to intel base chip, this kinda find away!!!

On top, the error thrown during the docker build was far from easy to diagnose. 
Bottom line is that by specifying an architecture at build time, the CRAN based 
steps works as advertised

Running on Mac with M1 chip the following completes as expected. But this is a 
good wake up call for me who just switched to a new Mac in January, doing 
consulting works on serverless infrastructure , no more huge AWS based 
instances to build on!

Thanks a lot

Working solution:

$ docker build -t r-base --platform linux/amd64 .

Dockerfile:
FROM ubuntu:22.04

USER root

ENV DEBIAN_FRONTEND noninteractive

## Configure Ubuntu for R install
RUN apt update \
  && apt install -y --no-install-recommends \
  software-properties-common \
  dirmngr \
  gnupg2 \
  wget \
  && 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 "deb https://cloud.r-project.org/bin/linux/ubuntu 
$(lsb_release -cs)-cran40/"

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





> On Mar 27, 2024, at 5:34 PM, Dirk Eddelbuettel <e...@debian.org> wrote:
> 
> 
> Marco,
> 
> It usually helps to be aware of one's hardware platform ;-)
> 
> There is an option for Docker command to tell it to switch to x86_64, my
> colleagues who are on M1 and alike use that to access the generally richer
> eco-system of binaries for the Intel world. If on the other hand you prefer
> to fully self-sufficient and compile 'everything' you now at least know that
> the RRutter PPA gives you R.
> 
> Michael:  Should we look into mirroring both architectures?
> 
> Cheers, Dirk
> 
> -- 
> dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org


        [[alternative HTML version deleted]]

_______________________________________________
R-SIG-Debian mailing list
R-SIG-Debian@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-debian

Reply via email to