#### 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_org <- params$docker_org docker_registry <- params$docker_registry cont <- params$cont docker_url <- if(grepl("ghcr.io",docker_registry)){ paste("https://ghcr.io",cont,sep="/") } else { paste("https://hub.docker.com/repository/docker",docker_org,pkg,sep="/") }
r PKG
is now available via r docker_registry
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 cont`
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 8900:8787 \ `r cont`
<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 cont`
For troubleshooting, see the Singularity documentation.
Finally, launch the containerised Rstudio by entering the following URL in any web browser: http://localhost:8900/
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.