Data Science / Methodology

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://github.com/StefanoPicozzi/4CastR2
$ 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://github.com/StefanoPicozzi/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

Advertisements

One thought on “RStudio Server as a Docker Container

  1. Pingback: RStudio Server Fedora Installation | the change architect

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s