@kevinushey Thanks for getting back to me ...
So very embarrassing but but my renv folder was being copied to the wrong location in the Dockerfile. It was being copied to /renv/ instead of /root/project/renv.
Now the Dockerfile build doesn't try to re-download and re-build all the packages when doing
RUN R -e "renv::restore(lockfile='/tmp/renv.lock', library='/root/project/renv/library/R-4.0/x86_64-pc-linux-gnu')"
However, R still does not appear to recognize the library as I can't library() any of the packages included in '/root/project/renv/library/R-4.0/x86_64-pc-linux-gnu
I tried setting various environment variables with
ENV RENV_PATHS_ROOT=/root/project/renv
ENV RENV_PATHS_LIBRARY=/root/project/renv/library
RUN echo "RENV_PATHS_ROOT=${RENV_PATHS_ROOT}" >> ${R_HOME}/etc/Renviron
RUN echo "RENV_PATHS_LIBRARY=${RENV_PATHS_LIBRARY}" >> ${R_HOME}/etc/Renviron
but it doesn't seem to help.
Entering the container, running R, and running
renv::restore(lockfile='/tmp/renv.lock', library='/root/project/renv/library/R-4.0/x86_64-pc-linux-gnu')
returns
The library is already synchronized with the lockfile.
but something like
library('Seurat')
returns
Error in library("Seurat") : there is no package called ‘Seurat’