In an effort to apply the MLOps "shift left" approach I switched from virtual environments to containers for each project. The thing is, that I want to take a record of the R packages' version that I use, so that when I build my container from a Dockerfile
I have a container with al the right packages.
My current approach is to use the renv
lockfile and call renv::restore()
in the Dockerfile
. This approach works but whenever I do a snapshot of the environment renv
creates all other hooks such as the renv
folder and the .Rprofile
which are useless in my container since the only environment I have is the one of the container.
Is there a clever way to do it?