No local installation of R or RStudio from now!

I only use Docker images now for my R and RStudio needs.

I’ve not installed R or RStudio on my local machine, though I work at Bioconductor, *a total R shop*. I spend most of my day in R.

I’ve implemented a couple of new images called the bioconductor/bioconductor_docker . They have the most recent release of Bioconductor with R 3.6.2 and devel version of Bioconductor and R (“Unsuffered Consequences").

I alias both containers from my .zshrc file, (if you use the bash shell, you’ll have a .bashrc file. If you don’t know which shell you are using try,echo $0):

For the RELEASE_3_10 alias, add

## RELEASE_3_10
alias dockR_3_10=’docker run --rm -d \
-e PASSWORD=bioc \
-p 8787:8787 \
-v ~/shared/RELEASE_3_10/library-store/:/usr/local/lib/R/host-site-library \
-v ~/Documents:/home/bioc

For the devel alias, add

## Devel
alias dockR=’docker run --rm -d \
-e PASSWORD=bioc \
-p 8888:8787 \
-v ~/shared/devel/library-store/:/usr/local/lib/R/host-site-library \
-v ~/Documents:/home/bioc

Once you have added these commands, either restart your Terminal or source .zshrc file.

Access RStudio on your browser at https://localhost:8787 (release) or https://localhost:8888 (devel) with username: biocand password: bioc.

Some notes about these commands,

  1. The RStudio username for these containers is going to be bioc . If you **DON’T** want any authentication, you can replace the line -e PASSWORD=<my password> with -e DISABLE_AUTH=true . This will let RStudio login without any authentication.
  2. I can simultaneously launch both versions of R on my local machine, and have two running RStudio instances, devel at https://localhost:8888 and RELEASE_3_10 at https://localhost:8787.
  3. I like have the --rm because running containers with --rm flag is good for those containers that you use for short while just to accomplish something, e.g., compile your application inside a container, or just testing something that it works, and then you are know its a short lived container and you tell your Docker daemon that once its done running, erase everything related to it and save the disk space. But this is not needed for most people.
  4. The -d will detach and run container in background and print container ID.
  5. If you want the bioc user to be a ROOT user, i.e with sudo capabilities to install new linux dependencies, you can add the environment variable -e ROOT=true .

Links and More information:





Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store