Skip to content

yuvipanda/binder-1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stability-experimental Build Status

rocker/binder

Adds binder abilities on top of the rocker/geospatial images.

Deploy methods

Using beta.mybinder.org services

This approach uses the public binder cloud and requires no installation

Just add a file named Dockerfile with the following contents to the root of a GitHub repository:

FROM rocker/binder:3.4.2

## Copies your repo files into the Docker Container
USER root
COPY . ${HOME}
RUN chown -R ${NB_USER} ${HOME}

## Become normal user again
USER ${NB_USER}

## Run an install.R script, if it exists.
RUN if [ -f install.R ]; then R --quiet -f install.R; fi

If you add an install.R file to the root directory of your GitHub repo as well, any R commands in that file will automatically be run as well. This should make it easier for users to install additional R packages from CRAN, GitHub etc by just writing R code to do so.

Note You can extend this Dockerfile if necessary to include additional system dependencies; see Troubleshooting below.

Want Button!

To launch on https://beta.mybinder.org, go to that address and enter the https address of your GitHub repository. You can also create a shiny badge for your README.md by adding the following markdown text:

[![Binder](http://mybinder.org/badge.svg)](http://beta.mybinder.org/v2/gh/<GITHUB_USER>/<REPO>/<BRANCH>)

filling in <GITHUB_USER>, <REPO> and <BRANCH> as appropriate. Here is an example badge to launch the binder-examples/dockerfile-rstudio repo.

Binder

See https://github.com/binder-examples/dockerfile-rstudio for a minimal example.

Running on your own machines, Using Docker

This approach works on any machine on which you have Docker installed.

The rocker/binder images can be run like any other docker image:

docker run -p 8888:8888 rocker/binder

Note that binder will run Juyter Notebook on port 8888 by default. The above command will print to the terminal (and the docker container log) the URL which includes a randomly generated token for secure login, so be sure to include that in the URL you paste into the browser.

Opening RStudio once Binder Launches

Once inside Jupyter Notebook, RStudio Server should be an option under the menu "New":

That should start you into an RStudio session (with no further login required).

Troubleshooting

It didn't work! What do I do now?. If you are installing additional R packages, this will sometimes fail when a package requires an external library that is not found on the container. We're working on a more elegant solution for this case, but meanwhile, you'll need to modify the Dockerfile to install these libraries. For instance, the gsl R package page reads

SystemRequirements:	Gnu Scientific Library version >= 1.12

To solve this, you will need to add the following line to your Dockerfile, right after the line that says USER root:

RUN apt-get update && apt-get -y install libgsl-dev

Or, just get in touch by opening an issue. We'll try and resolve common cases so more things work out of the box.

Credits

About

Adds binder to tidyverse, providing JupyterHub

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Makefile 100.0%