This repository provides Dockerfiles for provisioning a completely portable environment for reproducible research in R.
On a Mac or Windows machine, you'll need boot2docker
installed (easy point & click install, ~24 MB).
([Mac],
[Windows]).
Note: Requires a docker version >= 1.2
, so please make sure
you have a recent version of docker available. Linux users
should use the curl script provided by Docker rather than the
older version available in the distro repository. Docker
only runs on 64 bit machines at this time.
- Launch boot2docker, and do:
sudo docker run -d -p 8787:8787 cboettig/ropensci
That will take a while to download the image the first time you run it.
- Once it is done, try:
boot2docker ip
that should return an ip address you can paste into your browser.
-
Add a
:8787
to the end of this address and paste it into your browser address bar. (e.g. it's probablyhttp://92.168.59.103:8787
but that can change). -
You should get the RStudio welcome screen. you should be able to login with user/password
rstudio/rstudio
, and be able to run stuff, install packages, use git, etc.
Life is easier. Install the latest version of docker via a script: (Other flavors are similar, see: Docker's instructions for your favorite distro)
curl -sSL https://get.docker.io/ubuntu/ | sudo sh
Now we're good to roll:
sudo docker run -d -p 8787:8787 cboettig/ropensci
RStudio should now be at http://localhost:8787
with login as mentioned above.
- Customize the user name, password, and email address used in git config:
docker run -d -p 8787:8787 -e USER=<username> -e PASSWORD=<password> -e [email protected] cboettig/ropensci
- Launch an R terminal session instead of using Rstudio
docker run --rm -it cboettig/ropensci /usr/bin/R
- Launch a bash session
docker run --rm -it cboettig/ropensci /bin/bash
- Link the container to a local folder (directory) using the
-v
option (linux only?). This acts much like runningR
in the working directory:
docker run --rm -it -v $(pwd):/home/rstudio/$(basename "$PWD") cboettig/ropensci /usr/bin/R
- Use a lighter weight RStudio image: the commands above use the image
named
cboettig/ropensci
from the Docker Hub, which includes many commonly used R packages (see Dockerfile underropensci/
in thsi repo). For a lighter-weight image, usecboettig/rstudio
.
Carl Boettiger [email protected]
MIT
RStudio and Shiny are registered trademarks of RStudio, Inc. The use and distribution of these RStudio Marks with the RStudio binaries through these images hosted on hub.docker.com has been granted by explicit permission of RStudio, as described under RStudio's trademark use policy. Address inqueries about further distribution or other questions to [email protected].