This is a simple repo that builds on rocker to build and add ipoptr. It was built for my friend Simone, hence the username and password.
Everything (R, RStudio, ipoptr) is contained in this image. In addition, the directory my-r-code
is mounted into the container at run time, so remember to save stuff there when working in R Studio.
-
docker-compose (optional, but handy if you can get).
[you@your-project]: mkdir my-r-code # place all your code here
[you@your-project]: docker run -p 80:8787 --name="simoner" -e ROOT=TRUE -e USER=simoner -e PASSWORD=boom -v $(pwd)/my-r-code:/my-r-code -d coderigo/docker-ipoptr
[you@your-project]: git clone https://github.com/coderigo/docker-ipoptr.git && cd docker-ipoptr
[you@your-project]: docker-compose build # run only once or replace "build : ." with "image : coderigo/docker-ipoptr" in docker-compose.yml
[you@your-project]: docker-compose up
[you@your-project]: docker-compose kill && docker-compose rm # kill and remove
Now travel to the IP address reported by echo $DOCKERHOST
or boot2docker ip
, log in with the username simoner
and password boom
and begin developing. Your scripts (which you'll version control with git, right?) within R studio will be available by setting your working directory to setwd("/my-r-code")
, even after killing the container.
Look in this directory's my-r-code
subdirectory for a simple script to test things out.
setwd("/my-r-code/")
source("testIpoptr.R")