Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is RENV_PATHS_CACHE_HOST? -- docker documentation

Tags:

docker

r

renv

In the docker vignette/documentation, they give an example with a shiny app, but don't exactly specify what their parameters mean. Some of them are self explanatory, but others aren't. More specifically:

https://rstudio.github.io/renv/articles/docker.html

RENV_PATHS_CACHE_HOST=/opt/local/renv/cache
RENV_PATHS_CACHE_CONTAINER=/renv/cache
docker run --rm \
    -e "RENV_PATHS_CACHE=${RENV_PATHS_CACHE_CONTAINER}" \
    -v "${RENV_PATHS_CACHE_HOST}:${RENV_PATHS_CACHE_CONTAINER}" \
    -p 14618:14618 \
    R -s -e 'renv::restore(); shiny::runApp(host = "0.0.0.0", port = 14618)'

What is RENV_PATHS_CACHE_HOST? And is RENV_PATHS_CACHE_CONTAINER the location of where my cache will be upon running the image instance/container?

I'm not entirely sure how to use this example, but feel I'll need it.

like image 837
no_dice Avatar asked Oct 23 '25 14:10

no_dice


1 Answers

The example here tries to demonstrate how one might mount an renv cache from the host filesystem on to a Docker container.

In this case, RENV_PATHS_CACHE_HOST points to a (theoretical) cache directory on the host filesystem, at /opt/local/renv/cache, whereas RENV_PATHS_CACHE_CONTAINER points to the location in the container where the host cache will be visible.

like image 150
Kevin Ushey Avatar answered Oct 26 '25 05:10

Kevin Ushey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!