When building Docker containers (or CI things for, like, GitHub) for #rstats, is there a way to know which apt-based packages you need to install beforehand? I always end up rebuilding, finding a new error, googling the name of the missing library, and repeating over and over until it builds and *surely* there's a better way??

@andrew If you use one of the rig containers [1], it is set up for binary R packages (on amd64) and automatic system package installation (or any arch), so all you need is

FROM ghcr.io/r-lib/rig/ubuntu-22.04-release
RUN R -q -e 'pak::pkg_install("tidyverse")'

Or you can use any container you like, install pak [2], and set up binary packages [3] manually if you like

[1] https://github.com/r-lib/rig#id-container
[2] https://pak.r-lib.org/reference/install.html
[3] https://packagemanager.posit.co/

GitHub - r-lib/rig: The R Installation Manager

The R Installation Manager. Contribute to r-lib/rig development by creating an account on GitHub.

GitHub

@andrew Also, if you just want to look them up, this works on any system:

pak::pkg_sysreqs("tidyverse", sysreqs_platform="ubuntu-22.04")

@gaborcsardi ahhh this is perfect! Thanks!

@andrew @gaborcsardi along this line, we've run into this problem enough that we've set up a GH action to check all our R-centric docker images for the sysdeps.

https://github.com/RMI-PACTA/actions/blob/main/.github/workflows/docker-check-R-sysdeps.yml

actions/.github/workflows/docker-check-R-sysdeps.yml at main · RMI-PACTA/actions

Actions for GitHub workflows. Contribute to RMI-PACTA/actions development by creating an account on GitHub.

GitHub