How to build docker image with devtool packages

I want to build a docker stack with r packge that lives on devtool. The package I want to add is Xiranga.

In Dockerfile I have the following

RUN R -e "install.packages("xaringanthemer", repos = "devtools::install_github("gadenbuie/xaringanthemer")"

I am building it on top of "FROM rocker/tidyverse".

When I run the build I get "Error: unexpected end of input".

I have 'devtools' package installed from R and is working fine from CLI. Not even sure, if it is possible to install packge from devtool on docker. Just need a sanity check.

Thanks,

Of course it's possible. The problem you are facing comes down to the fact that you are using the same quotes and docker gets confused. If you want to quote something inside of a string, then you need to use another type of quote, e.g.:

"this is a string and 'this is a string inside another string'"

@mishabalyasin thanks for quick response.

Here is what I have:
RUN R -e "install.packages('xaringan', repos = 'devtools::install_github('gadenbuie/xaringan')' "

What am I missing?

This looks very weird. Why do you have devtools command in repos?
Were you trying to do this:

 RUN R -e "devtools::install_github('gadenbuie/xaringan')"

?

TBH, this is my first devtool install. Was not quite sure the command. Thanks for your recommendation. that worked!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.