#### Package name #### pkg <- read.dcf("../DESCRIPTION", fields = "Package")[1] library(pkg, character.only = TRUE) ## Docker containers must be lowercase pkg <- tolower(pkg) #### Username of DockerHub account #### docker_user <- "bschilder"
r pkg
is now available via
DockerHub
as a containerised environment with Rstudio and
all necessary dependencies pre-installed.
First, install Docker if you have not already.
Create an image of the Docker container in command line:
docker pull `r docker_user`/`r pkg`
Once the image has been created, you can launch it with:
docker run \ -d \ -e ROOT=true \ -e PASSWORD="<your_password>" \ -v ~/Desktop:/Desktop \ -v /Volumes:/Volumes \ -p 8787:8787 \ `r docker_user`/`r pkg`
<your_password>
above with whatever you want your password to be. -v
flags for your particular use case. -d
ensures the container will run in "detached" mode,
which means it will persist even after you've closed your command line session. If you are using a system that does not allow Docker (as is the case for many institutional computing clusters), you can instead install Docker images via Singularity.
singularity pull docker://`r docker_user`/`r pkg`
Finally, launch the containerised Rstudio by entering the following URL in any web browser: http://localhost:8787/
Login using the credentials set during the Installation steps.
utils::sessionInfo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.