Skip to content

Instantly share code, notes, and snippets.

@lgaborini
Created September 8, 2022 13:43
Show Gist options
  • Save lgaborini/afc9719a5d38b19a4b5423213eafafb7 to your computer and use it in GitHub Desktop.
Save lgaborini/afc9719a5d38b19a4b5423213eafafb7 to your computer and use it in GitHub Desktop.
remotes-repos-reprex
FROM rocker/verse:4.2.0
RUN R -q -e 'install.packages("remotes")'
# add a new file-based remote to options()$repos
COPY setup_repos.R setup_repos.R
# add it on startup
RUN mkdir -p /usr/local/lib/R/etc/ /usr/lib/R/etc/
RUN cat setup_repos.R | tee /usr/local/lib/R/etc/Rprofile.site | tee /usr/lib/R/etc/Rprofile.site
RUN R -q -e 'options()$repos'
RUN R -q -e 'remotes::install_git("https://github.com/hadley/stringr.git")'
cat("Setting custom local repos\n")
r <- getOption("repos")
r["drat"] <- "file://drat"
# r["drat"] <- "drat"
options(repos = r)
rm(r)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment