R package binaries are not loaded during installation; missing or incompatible system libraries are not detected until the package is loaded at runtime.
We can see this problem with the rjags R package, which depends upon the jags system library.
Given this Dockerfile.pkg-config, a binary of rjags installs successfully, but then fails to load.
FROM rstudio/r-base:4.3-jammy
RUN apt-get update && apt-get -y install pkg-config
ARG REPOSITORY=https://packagemanager.rstudio.com/cran/__linux__/jammy/latest
RUN R -s -e "install.packages('rjags', repos=c(CRAN='${REPOSITORY}'))" && R -s -e "cat('POST-INSTALL:\n');library(rjags)"
R package binaries are not loaded during installation; missing or incompatible system libraries are not detected until the package is loaded at runtime.
We can see this problem with the
rjags
R package, which depends upon thejags
system library.Given this
Dockerfile.pkg-config
, a binary ofrjags
installs successfully, but then fails to load.Building:
The output includes:
This shows that library-load issues are not detected during installation when using binary packages.