r-devel / r-dev-day

Repo to organize tasks for R Dev Days
7 stars 2 forks source link

R Dev Container: Multi-platform build of the Docker container #63

Open hturner opened 2 months ago

hturner commented 2 months ago

The R Dev Container was primarily built for use with GitHub Codespaces (now extended to Gitpod Workspaces), so the underlying Docker container is built for linux/amd64 architecture. This means that it doesn't work well on M+ macOS or Windows as discussed in issue 112 of the R Dev Container repo.

@StarTrooper08 has attempted to use buildx to build a linux/amd64 image but got stuck.

If anyone with experience in this area can help us make progress on this issue it would be appreciated!

hturner commented 1 month ago

Notes from RSECon24 added to https://github.com/r-devel/r-dev-env/issues/112. t

To summarise: The dockerfile uses the Ubuntu r-project repo to install r-base-core when building the container, but this doesn't have a recent arm build (most recent when we tried was 4.1.2). There may be a more recent arm build in the debian r-project repo, so that may be a potential solution.

sjimellor-jr commented 1 month ago

A few findings from looking into this issue.

Current status:

hturner commented 1 month ago

Thanks @sjimellor-jr for digging into this! Your (off GitHub) comment about "why there isn't an ARM build of the Debian/Ubuntu package in the first place" got me wondering and after some searching around I found from the rocker/r-ubuntu Dockerfile that they use "ppa:marutter/rrutter4.0" as the repository vs "https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/". I tried building from the R Dev Container Dockerfile with Michael Rutter's base R PPA as the R repository and the build was successful on my ARM machine!

I think we will now be able to get this working with buildx. I'll leave this issue open for the moment and hopefully update it when we've got that working!