Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

adding R package for installation from Github in Dockerfile

Tags:

docker

r

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?

like image 759
Forge Avatar asked Jan 04 '23 06:01

Forge


1 Answers

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/
like image 127
useRj Avatar answered Jan 06 '23 19:01

useRj