R version 3.3.1. Any plots will display via X socket mounting.
WHAT DOES THIS DO?
This is a container that runs R... not any of the R IDEs.
HOW TO RUN IT?
- Make sure you're on a system running X.
- Disable X access control (don't do this on a public-facing machine):
$ xhost +
$ cdto a path where you want to do some R.
$ docker run --rm -it -v /tmp/.X11-unix:/tmp/.X11-unix -v `pwd`:`pwd` -e DISPLAY=$DISPLAY -e RWORK=`pwd` hackenfreude/r-3.3.1
- You'll end up on the R command line. Do some R. If you tell it to plot something, you'll see the plot come up on your screen.
> q()will quit R and kill the container. Any files you created will be on the path of the host where you started.
- Reenable X access control:
$ xhost -
WHAT JUST HAPPENED?
- Docker mounted the host's X socket in the continer as the container's X socket; this allows the container's GUI to pass back up to the host. This is only relevant if you plot something.
- Docker mounted the host's working directory in the container at the same path.
- Rprofile.site tells R set its working directory to the RWORK environment variable. Part of the
docker runcommand above sets
RWORKin the container as the host's working directory.
WHAT IF IT DOESN'T WORK?
Open an issue.
Docker Pull Command