renv stores it's cache in ~/.cache/R/renv by default. We need to ensure containers use their own isolated package cache.
We don't currently override or bind this path (eg RENV_PATHS_ROOT) to an alternative location - this can result in undesirable interactions between cached packages that were compiled on the host and attempting to use/compile the same package in a container, when underlying linked system library versions don't match.
Test case was DirichletMultinomial and conflicting versions of libgsl:
renv::activate()
install.packages("BiocManager")
BiocManager::install("DirichletMultinomial")
library(DirichletMultinomial)
Removing the renv folder in the project didn't resolve the issue, since this doesn't remove the package cache shared between the host R and the container R.