Open leungi opened 4 years ago
Current hacky workaround:
repo <- 'https://cran.rstudio.com/'
pkgs <- paste(setdiff(names(sessionInfo()$otherPkgs), 'containerit'),
collapse = ' ')
my_run_pkg <- Run("install2.r", glue::glue('-r {repo} {pkgs}'))
my_dockerfile <- dockerfile(
from = NULL,
image = "trestletech/plumber"
)
addInstruction(my_dockerfile) <- list(my_run_pkg)
print(my_dockerfile)
#> FROM trestletech/plumber
#> LABEL maintainer="leungi"
#> RUN ["install2.r", "-r https://cran.rstudio.com/ sp randomForest"]
Hihi @leungi - thank you for the suggestion. Sometimes CRAN mirrors can be a bit out of sync, so in your case the package randomForest
should also be available on the cloud.rproject - mirror by now.
Anyway, I agree being able to define the used repo is a useful feature to expose to the user, I've added it to the next tasks.
I just tested again, and confirmed that both CRAN and cloud-r contains the same source code randomForest_4.6-14.tar.gz
.
However, I still get the same error message as above when specifying the latter as repo to download libraries.
I checked for firewall issue, but not the case, since I'm able to download via http.
Were you able to replicate?
Reproducible example below.
Proposal:
dockerfile(repo = "https://cloud.r-project.org", ...)
, and then insertrepo
intoRUN ["install2.r", repo, "randomForest"]
.