Search code examples
rdockercran

Changing a `docker` example script to run on a local file (R package)


This blog post contains a very cool script to run CRAN tests on R package inside a docker container. For example this script runs the CRAN check on the RcppAnnoy package:

docker run --rm -ti -v $(pwd):/mnt rocker/r-devel-ubsan-clang check.r --setwd /mnt --install-deps RcppAnnoy_0.0.6.tar.gz 

My question is simple: in this example, the tested package (RcppAnnoy_0.0.6.tar.gz) can be substituted by any package that can be downloaded from CRAN. How should I change the script to substitute RcppAnnoy_0.0.6.tar.gz by a R package found on my computer?


Solution

  • How should I change the script to substitute RcppAnnoy_0.0.6.tar.gz by a R package found on my computer?

    Simply copy your R package in your current directory, since the docker run command will mount pwd (where your package would be) to /mnt, and the check.r command will set the wd (working directory) to the same /mnt.