No local installation of R or RStudio from now!

## 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
bioconductor/bioconductor_docker:RELEASE_3_10’
## 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
bioconductor/bioconductor_docker:devel’
  1. I share two volumes, first, the compiled libraries are stored on a mounted volume from my local machine, ~/shared/<Bioconductor version>/library-store/ , and second, my set of files I’d like to work in~/Documents . I bind these volumes to paths which are defined to work, like the /usr/local/lib/R/host-site-library [this is first on the search path .libPaths() ] and /home/bioc [just the home directory].
  2. 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.
  3. 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.
  4. 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.
  5. The -d will detach and run container in background and print container ID.
  6. 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 .

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

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