将本地文件(R 包)上的“docker”示例脚本更改为 运行

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

This 博客 post 包含一个 非常 很酷的脚本 运行 CRAN 测试 R 包在 docker 容器内。例如这个脚本 运行s CRAN 检查 RcppAnnoy 包:

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

我的问题很简单:在这个例子中,测试包(RcppAnnoy_0.0.6.tar.gz)可以用任何可以从CRAN下载的包代替。我应该如何更改脚本以将 RcppAnnoy_0.0.6.tar.gz 替换为在我的计算机上找到的 R 软件包?

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

只需将 R 包复制到当前目录,因为 docker run command will mount pwd (where your package would be) to /mnt, and the check.r command 会将 wd(工作目录)设置为相同的 /mnt