简体   繁体   中英

adding R package for installation from Github in Dockerfile

How must I add installation instruction for a R package using github with my Dockerfile.

The usual command in R environment is:

devtools::install_github("smach/rmiscutils")

But no success so far. Tried to add github repo to installation instructions:

RUN install2.r --error \ 
    -r 'http://cran.rstudio.com' \
    -r 'http://github.com/smach/rmiscutils' 

But I get an error:

error in download. Status was '404 Not found'

Maybe using vanilla R call but can't figure the command. Any Hint?

Try this:

RUN installGithub.r smach/rmiscutils \
&& rm -rf /tmp/downloaded_packages/

A good practice is to remove all downloaded packages to reduce image size.

Here added command when installing from Bioconductor (in case someone ends here searching for help)

RUN install2.r -r http://bioconductor.org/packages/3.0/bioc --deps TRUE \
    phyloseq \
    && rm -rf /tmp/downloaded_packages/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM