Data ScienceOpenShiftR

RStudio Server as a Docker Container

Overview

[ UPDATE ] A new and improved approached to standing up a RStudio Server as a container instance can be found here.

This post is an example of how to make it easy to distribute a functional RStudio Server environment for R as a single pre-baked image which can be installed in 2 steps.

The demonstration used takes the 4CastR method blogged previously and sets it up as a fully configured ready-to-run Docker container.  Prerequisite is that you have Docker installed.  If using a Mac OS/X you may want to consider installing boot2docker.

Pull down then run container

$ docker pull spicozzi/rstudio 
$ git clone https://bitbucket.org/emergile/4CastR2


nbsp;docker run -it -p 80:8787 -v $PWD/4CastR2:/home/guest spicozzi/rstudio

Launch Console and try sample

Point your browser to the URL of the launched RStudio Server container. If using Mac OS/X with boot2docker you can find this using the “boot2docker ip” command.  Login as guest with password guest.

Screen Shot 2015-06-15 at 11.44.52 am

Try your own R commands or attempt the sample R program provided.  To do this select the 4CastR2-Example.R file and then select the Source command to run it.

Screen Shot 2015-06-15 at 11.45.19 am

Inspect the graph created by choosing the 4CastR2-Example.png file.

Screen Shot 2015-06-15 at 11.45.50 am

Bits ‘n Pieces

https://bitbucket.org/emergile/4CastR2

OpenShift V3

The git repo also contains the json configuration file to launch this as an OpenShift V3 application.  Prerequisite is that you have an OpenShift V3 environment.  You can then login as an OpenShift developer user, create a project and then run the create script as per below.  Visit the OpenShift Console and click the link for the generated route.

$ osc create -f rstudio-complete.json

Once created, the OpenShift Console will show a service definition such as:

Screen Shot 2015-06-15 at 3.21.03 pm

Leave a Reply