Sign inSign up

areedv/rap-dev

By areedv

Updated over 7 years ago

Desc

Image
1

293

areedv/rap-dev repository overview

R development environment for Rapporteket

Introduction

This is a Docker file for an R developing environment to be used in task related to reporting services at Rapporteket.

The Docker container builds ontop of verse and has the rapbase (rel branch) and raptools R packages (and their dependencies) pre-built. In addition, shiny-server is also enabled.

Usage

When running the docker image your container will be accessed by a web-browser pointing at given ports at localhost.

Plain

Run the rap-dev container from command line:

docker run -e PASSWORD=password --rm -p 3838:3838 -p 8787:8787 areedv/rap-dev:latest

This will download the image from hub.docker.com and run the container exposing it on localhost:3838 (shiny-server) and localhost:8787 (RStudio) through your web-browser. PASSWORD setting will be used for logging into RStudio within the container. The --rm option removes the container when the session is terminated (ctrl + c).

Behind a proxy

Depending on your environment and usecases being behind a proxy server might cause minor or even major problems. One or both of the below steps might help you get going.

To make the docker client aware of your proxy add the following to your json configuration file (e.g. ~/.docker/config.json):

{
  "proxies": {
    "default": {
      "httpProxy": "[your.proxy.ip]:[your_proxy_port_number]",
      "httpsProxy": "[your.tls-proxy.ip]:[your_proxy_port_number]",
      "noProxy": "test.site1.com,*.site2.com,*.site3.com"
    }
  }
}

In addition, to make your console in RStudio within the container aware of the proxy environment variables the container image must also contain these settings (you will need this for instance if doing things like install.packages() from the RStudio console within the container). This requires rebuilding of the docker image and in order to do so you will need the Dockerfile which is available from github (this repo). If you havent already done so, clone this repository to your own computer:

git clone https://github.com/Rapporteket/docker.git --config core.autocrlf=input

Move into the directory docker/rap-dev and rebuild the container with the PROXY build argument:

docker build --build-arg PROXY=http://[your.proxy.ip]:[your_proxy_port_number] -t rap-dev .

The above method uses the PROXY value both for HTTP_PROXY and HTTPS_PROXY. Then, run the newly configured container from your local docker image repo:

docker run -e PASSWORD=password --rm -p 3838:3838 -p 8787:8787 rap-dev
Add one or more nameservers

Somewhat related to proxied connections one might also need to define servers for name lookups (dns) explicitly. This can be done with the --dns option when running the container:

docker run --dns your.dns.server.ip --dns 8.8.8.8 -v ~/.ssh:/home/rstudio/.ssh -e PASSWORD=password --rm -p 3838:3838 -p 8787:8787 areedv/rap-dev:latest
Interact with GitHub with secure shell and public key

Probably you will need to interact witn the Rapporteket organization at GitHub. Applying secure shell (ssh) and key-pairs for this purpose will make its use alot more convenient. Having exposed your public key to GitHub it is staight forward to re-use your existing ssh-setup also within the rap-dev-container simply by allowing the container to access the directory containing your ssh-settings. The example below shows an entry from ssh config (e.g ~/.ssh/config) that also apply includes a proxy server that need to be traversed:

Host githubThroughProxy
        HostName github.com
        User git
        ProxyCommand /bin/nc -X connect -x your.proxy.ip:yourProxyPort %h %p

Based on the above example access to the .ssh directory is defined by the -v option when running the container:

docker run -v ~/.ssh:/home/rstudio/.ssh -e PASSWORD=password --rm -p 3838:3838 -p 8787:8787 areedv/rap-dev:latest

Then, from within RStudio in your container new projects can be started from GitHub refering to githubThroughProxy:usernameOrOrg/repository.

Tag summary

Content type

Image

Digest

Size

1.2 GB

Last updated

over 7 years ago

docker pull areedv/rap-dev