Rocker Project
  • Home
  • Code of Conduct
  • Images
    • The Rocker Images

    • versioned stack
    • r-ver
    • rstudio, tidyverse, verse, geospatial
    • binder
    • shiny, shiny-verse
    • cuda, ml, ml-verse

    • base stack
    • r-base
    • rocker/r-base
    • r-devel, drd, drp, r-devel-san, r-devel-ubsan-clang

    • Additional images
    • r-ubuntu
    • r-bspm
    • r2u

    • Dev Container
    • Features
    • Images
    • Templates

    • Other projects
    • External images and tools for R
  • Use
    • Extending images
    • GUI
    • Edit in containers
    • Networking
    • Shared Volumes
    • Running without root privileges using Podman
    • Reproducibility
    • Singularity
  1. versioned stack
  2. binder
  1. versioned stack
  2. binder

binder

  • The Rocker Images
  • versioned stack
    • r-ver
    • rstudio, tidyverse, verse, geospatial
    • binder
    • shiny, shiny-verse
    • cuda, ml, ml-verse
  • base stack
    • r-base
    • rocker/r-base
    • r-devel, drd, drp, r-devel-san, r-devel-ubsan-clang
  • Additional images
    • r-ubuntu
    • r-bspm
    • r2u

  • Dev Container
    • Features
    • Images
    • Templates

  • Other projects
    • External images and tools for R

On this page

  • 1 Quick reference
  • 2 Overview
  • 3 How to use
    • 3.1 Use outside of Binder
  • View source
  • Edit this page

1 Quick reference

  • Source repository: rocker-org/rocker-versioned2
  • Dockerfile
  • tags
    • DockerHub
    • GitHub Container Registry
  • Published image details: rocker-org/rocker-versioned2’s wiki
  • Non-root default user: rstudio

2 Overview

This image is based on rocker/geospatial and configured to run RStudio Server on Binder, thanks to jupyter-rsession-proxy.

For instructions on how to use this image with Binder for your project, see the rocker-org/binder, a template repository.

By placing the following badge in README.md of your project, RStudio can be started and used in the browser by simply clicking on the badge.

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/<GITHUB_USER>/<REPO>/<BRANCH>?urlpath=rstudio)

You can also make a Binder badge with usethis::use_binder_badge() R function.

Note

This document is for R 4.0.0 >= images.

3 How to use

3.1 Use outside of Binder

If you use this image with Docker, the default command runs JupyterLab. Since the JupyterLab port is set to 8888, you can open the JupyterLab screen on localhost:8888 from your browser with the following command.

docker run --rm -ti -p 8888:8888 rocker/binder

You can log in by entering the token displayed in the terminal as your password.

If you want to set your own password for Jupyter, you can set it as a environment variable JUPYTER_TOKEN1.

docker run --rm -ti -e JUPYTER_TOKEN=yourpassword -p 8888:8888 rocker/binder
Tip

RStudio Server started from Jupyter does not read environment variables set at container startup; if you want to use environment variables on your RStudio instance, set them on the .Renviron file.

To run RStudio Server directly as in rocker/rstudio, execute /init command with the root user specified.

docker run --rm -ti -p 8787:8787 --user root rocker/binder /init

Footnotes

  1. Jupyter Server Config file and command line options↩︎

 

CC-BY
  • View source
  • Edit this page