rocker-org/r2u

Can't build images on M1 Mac

Closed this issue · 4 comments

After cloning the repo and trying to build from either the focal or jammy Dockerfiles, I've run into errors that seem to be stemming from the R installation using apt-get. Here is what I get from focal:

 => ERROR [3/3] RUN apt-get update         && apt-get install -y --no-install-recommends     r-base     r-base-dev      2.3s 
------                                                                                                                       
 > [3/3] RUN apt-get update         && apt-get install -y --no-install-recommends  		r-base  		r-base-dev  		r-recommended                  r-cran-bspm                  r-cran-docopt                  r-cran-littler                  r-cran-remotes                  python3-dbus                  python3-gi                  python3-apt&& chown root:staff "/usr/local/lib/R/site-library" 	&& chmod g+ws "/usr/local/lib/R/site-library"   	&& ln -s /usr/lib/R/site-library/littler/examples/build.r /usr/local/bin/build.r   	&& ln -s /usr/lib/R/site-library/littler/examples/check.r /usr/local/bin/check.r   	&& ln -s /usr/lib/R/site-library/littler/examples/install.r /usr/local/bin/install.r  	&& ln -s /usr/lib/R/site-library/littler/examples/install2.r /usr/local/bin/install2.r 	&& ln -s /usr/lib/R/site-library/littler/examples/installBioc.r /usr/local/bin/installBioc.r  	&& ln -s /usr/lib/R/site-library/littler/examples/installDeps.r /usr/local/bin/installDeps.r  	&& ln -s /usr/lib/R/site-library/littler/examples/installGithub.r /usr/local/bin/installGithub.r  	&& ln -s /usr/lib/R/site-library/littler/examples/testInstalled.r /usr/local/bin/testInstalled.r   	&& ln -s /usr/lib/R/site-library/littler/examples/update.r /usr/local/bin/update.r         && echo "options(bspm.version.check=FALSE)" >> /etc/R/Rprofile.site         && echo "suppressMessages(bspm::enable())" >> /etc/R/Rprofile.site         && echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf.d/90local-no-recommends 	&& rm -rf /tmp/downloaded_packages/ /tmp/*.rds  	&& rm -rf /var/lib/apt/lists/*:
#0 0.147 Ign:1 https://r2u.stat.illinois.edu/ubuntu focal InRelease
#0 0.158 Get:2 https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/ InRelease [3,622 B]
#0 0.163 Get:3 https://r2u.stat.illinois.edu/ubuntu focal Release [5,713 B]
#0 0.179 Get:4 https://r2u.stat.illinois.edu/ubuntu focal Release.gpg [793 B]
#0 0.223 Get:5 https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/ Packages [86.9 kB]
#0 0.262 Get:6 https://r2u.stat.illinois.edu/ubuntu focal/main amd64 Packages [2,366 kB]
#0 0.280 Hit:7 http://ports.ubuntu.com/ubuntu-ports focal InRelease
#0 0.376 Hit:8 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease
#0 0.403 Get:9 https://r2u.stat.illinois.edu/ubuntu focal/main all Packages [7,490 kB]
#0 0.470 Hit:10 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease
#0 0.567 Hit:11 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease
#0 0.778 Fetched 9,953 kB in 1s (14.3 MB/s)
#0 0.778 Reading package lists...
#0 1.395 Reading package lists...
#0 1.998 Building dependency tree...
#0 2.107 Reading state information...
#0 2.172 Some packages could not be installed. This may mean that you have
#0 2.172 requested an impossible situation or if you are using the unstable
#0 2.172 distribution that some required packages have not yet been created
#0 2.172 or been moved out of Incoming.
#0 2.172 The following information may help to resolve the situation:
#0 2.172 
#0 2.172 The following packages have unmet dependencies:
#0 2.224  r-base : Depends: r-base-core (>= 4.3.1-4.2004.0) but 3.6.3-2 is to be installed
#0 2.224  r-base-dev : Depends: r-base-core (>= 4.3.1-4.2004.0) but 3.6.3-2 is to be installed
#0 2.224  r-cran-bspm : Depends: r-base-core (>= 4.3.0-1.2004.0) but 3.6.3-2 is to be installed
#0 2.224                Depends: r-api-4.0 but it is not installable
#0 2.224  r-cran-docopt : Depends: r-base-core (>= 4.1.3) but 3.6.3-2 is to be installed
#0 2.224                  Depends: r-api-4.0 but it is not installable
#0 2.224  r-cran-remotes : Depends: r-base-core (>= 4.2.2) but 3.6.3-2 is to be installed
#0 2.224                   Depends: r-api-4.0 but it is not installable
#0 2.224  r-recommended : Depends: r-base-core (>= 4.3.1-4.2004.0) but 3.6.3-2 is to be installed
#0 2.224                  Depends: r-cran-boot (>= 1.2.19) but it is not going to be installed
#0 2.224                  Depends: r-cran-codetools but it is not going to be installed
#0 2.231 E: Unable to correct problems, you have held broken packages.

And from jammy:

 => ERROR [3/3] RUN apt-get update         && apt-get install -y --no-install-recommends     r-base     r-base-dev      2.6s
------                                                                                                                       
 > [3/3] RUN apt-get update         && apt-get install -y --no-install-recommends  		r-base  		r-base-dev  		r-recommended                  r-cran-bspm                  r-cran-docopt                  r-cran-littler                  r-cran-remotes                  python3-dbus                  python3-gi                  python3-apt&& chown root:staff "/usr/local/lib/R/site-library" 	&& chmod g+ws "/usr/local/lib/R/site-library"   	&& ln -s /usr/lib/R/site-library/littler/examples/build.r /usr/local/bin/build.r   	&& ln -s /usr/lib/R/site-library/littler/examples/check.r /usr/local/bin/check.r   	&& ln -s /usr/lib/R/site-library/littler/examples/install.r /usr/local/bin/install.r  	&& ln -s /usr/lib/R/site-library/littler/examples/install2.r /usr/local/bin/install2.r 	&& ln -s /usr/lib/R/site-library/littler/examples/installBioc.r /usr/local/bin/installBioc.r  	&& ln -s /usr/lib/R/site-library/littler/examples/installDeps.r /usr/local/bin/installDeps.r  	&& ln -s /usr/lib/R/site-library/littler/examples/installGithub.r /usr/local/bin/installGithub.r  	&& ln -s /usr/lib/R/site-library/littler/examples/installRub.r /usr/local/bin/installRub.r  	&& ln -s /usr/lib/R/site-library/littler/examples/testInstalled.r /usr/local/bin/testInstalled.r   	&& ln -s /usr/lib/R/site-library/littler/examples/update.r /usr/local/bin/update.r         && echo "options(bspm.version.check=FALSE)" >> /etc/R/Rprofile.site         && echo "suppressMessages(bspm::enable())" >> /etc/R/Rprofile.site         && echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf.d/90local-no-recommends 	&& rm -rf /tmp/downloaded_packages/ /tmp/*.rds  	&& rm -rf /var/lib/apt/lists/*:
#0 0.133 Get:1 https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/ InRelease [3,626 B]
#0 0.156 Ign:2 https://r2u.stat.illinois.edu/ubuntu jammy InRelease
#0 0.172 Get:3 https://r2u.stat.illinois.edu/ubuntu jammy Release [5,713 B]
#0 0.188 Get:4 https://r2u.stat.illinois.edu/ubuntu jammy Release.gpg [793 B]
#0 0.201 Get:5 https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/ Packages [43.3 kB]
#0 0.257 Get:6 https://r2u.stat.illinois.edu/ubuntu jammy/main all Packages [7,459 kB]
#0 0.293 Hit:7 http://ports.ubuntu.com/ubuntu-ports jammy InRelease
#0 0.394 Hit:8 http://ports.ubuntu.com/ubuntu-ports jammy-updates InRelease
#0 0.496 Hit:9 http://ports.ubuntu.com/ubuntu-ports jammy-backports InRelease
#0 0.591 Hit:10 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease
#0 0.667 Get:11 https://r2u.stat.illinois.edu/ubuntu jammy/main amd64 Packages [2,354 kB]
#0 0.952 Fetched 9,867 kB in 1s (11.4 MB/s)
#0 0.952 Reading package lists...
#0 1.596 Reading package lists...
#0 2.209 Building dependency tree...
#0 2.361 Reading state information...
#0 2.446 Some packages could not be installed. This may mean that you have
#0 2.446 requested an impossible situation or if you are using the unstable
#0 2.446 distribution that some required packages have not yet been created
#0 2.446 or been moved out of Incoming.
#0 2.446 The following information may help to resolve the situation:
#0 2.446 
#0 2.446 The following packages have unmet dependencies:
#0 2.527  r-base : Depends: r-base-core (>= 4.3.1-4.2204.0) but 4.1.2-1ubuntu2 is to be installed
#0 2.527  r-base-dev : Depends: r-base-core (>= 4.3.1-4.2204.0) but 4.1.2-1ubuntu2 is to be installed
#0 2.527  r-cran-bspm : Depends: r-base-core (>= 4.3.0-1.2204.0) but 4.1.2-1ubuntu2 is to be installed
#0 2.527  r-cran-docopt : Depends: r-base-core (>= 4.2.0) but 4.1.2-1ubuntu2 is to be installed
#0 2.527  r-cran-remotes : Depends: r-base-core (>= 4.2.2) but 4.1.2-1ubuntu2 is to be installed
#0 2.527  r-recommended : Depends: r-base-core (>= 4.3.1-4.2204.0) but 4.1.2-1ubuntu2 is to be installed
#0 2.527                  Depends: r-cran-boot (>= 1.2.19) but it is not going to be installed
#0 2.527                  Depends: r-cran-codetools but it is not going to be installed
#0 2.528 E: Unable to correct problems, you have held broken packages.

It doesn't seem to be anything stemming from my OS, as far as I can tell, but I'm happy to provide any other info that might prove useful.

Correct. As r2u states right on its main webpage and README:

What is Covered ?

We generally support amd64 (i.e. standard 64-bit Intel/AMD cpus, sometimes also called x86_64) for the current Ubuntu LTS release and its predecessor release. We use 'r-release' just like CRAN. So currently the 'focal' 20.04 LTS and 'jammy' 22.04 LTS releases are fully supported.

So you simply cannot build an arm64 image for r2u as there is no arm64 content. Truly sorry.

@eddelbuettel my apologies for missing that! I'll try to build on my Linux machine- this was all in service of trying to work out some strange stuff happening with pandoc throwing OOM errors when I switched a Dockerfile's base image from rocker/r-ver:4 to rocker/r2u:jammy. Is it likely that this is also based on the arm64 build?

Not sure. I have zero exposure to such fancy hardware so I am in the dark as to whether rosetta etc can or cannot cover this for you. And pandoc generally comes as binary so hard to tell. One can cheat, rely on a rstudio or quarto (native) build and use that binary. I have done that in the past when then I got from my linux distro was too old.

Thanks for that tip Dirk, much appreciated!