data science tutorials and snippets prepared by tomis9
rocker
is docker container specially prepared for working with R programming language;
it is useful if your R model is a part of a microservice system based on docker containers;
you can run R/shiny-server/rstudio-server on any machine you want. The only requirement is docker.
An official site of rocker proposes a few versions of r images. The most interesting ones:
rstudio with rstudio server installed, to which you can connect with your favourite Internet browser;
shiny with shiny server installed, where you can easily publish your shiny applications. This may be particularly useful for Windows Server users, who may find it difficult to install a shiny server directly;
r-ver with, well, basic R version installed.
A nice tutorial on writing a Dockerfile you will here. As rocker
’s Dockerfile has it’s specific quirks, I present it in a separate blog post.
FROM rocker/r-ver:3.5.1
RUN Rscript -e "install.packages('futile.logger')"
RUN R -e "install.packages('devtools')"
RUN install2.r -e bookdown rticles
CMD R
We used 3 different methods to install packages. All of them all synonyms, so you can use whichever you like. Probably install2.r
has the cleanest syntax.
The you can build your image with:
docker build -t my_rocker:0.1 .
And you’re good to go!
hah, that’s funny. The guy who wrote the tutorial above started the first lesson with the words:
What is Docker and Why should I use it?
so in the same manner as I start every blog post.