My Dockerfile uses renv and I have the following RUN command (whole file here: https://github.com/chpatola/docker-r-tutorial/blob/main/local_file/Dockerfile)
RUN Rscript -e "renv::restore(prompt = FALSE)"
When it is run as I build the image, I get this message:
The library is already synchronized with the lockfile.
However, when I run a container from the image and start R (docker run -it -v "$(pwd):/usr/src/orders" --name data_cont handle_data), I get these messages:
The following package(s) have broken symlinks into the cache:
assertthat, cli, crayon, digest, dplyr, ellipsis, fansi, generics, glue, lifecycle, lubridate, magrittr, pillar, pkgconfig, purrr, R6, Rcpp, rlang, tibble, tidyselect, utf8, vctrs
Use
renv::repair()
to try and reinstall these packages.
The project may be out of sync -- use
renv::status()
for more details. Warning message: The following package(s) are missing entries in the cache:assertthat, cli, crayon, digest, dplyr, ellipsis, fansi, generics, glue, lifecycle, lubridate, magrittr, pillar, pkgconfig, purrr, R6, Rcpp, rlang, tibble, tidyselect, utf8, vctrs
These packages will need to be reinstalled.
I do not understand what has gone wrong here. On my dev computer, I called renv::init()
and then renv::isolate()
. What can I do to get the package installation from renv::restore()
to instal the packages properly so they can be loaded normally when the container is run? Thanks!