Sign inSign up

hcp4715/rdock

By hcp4715

•Updated over 2 years ago

R images used in projects in the Lab

Image
Data science
0

10K+

hcp4715/rdock repository overview

⁠R images for published studies in Chuan-Peng's team⁠

This repo is to ensure reproducibility of the lab. This tutorial⁠ helped us to build and maintain this repo, many thanks.

⁠Images and their associated projects

⁠Why use these images

Please see here⁠ for why using docker.

⁠How to use one of these docker images for reproducing

⁠Step 1: install docker

Linux (ubuntu): https://docs.docker.com/engine/install/ubuntu/⁠

Windows 10: https://docs.docker.com/docker-for-windows/install/⁠

Mac OS: https://docs.docker.com/docker-for-mac/install/⁠

Make sure that docker was successfully installed on your machine

⁠Step 2: pull an image form dock hub
docker pull hcp4715/rdock:fadpls           # This is the image for FAD+ project
⁠Step 3: run the docker image
docker run -e PASSWORD=hulab --cpus=4 -it --rm -p 8787:8787 -v ${PWD}:/home/rstudio/work hcp4715/rdock:fadpls 

docker run ---- Run a docker image in a container

-e PASSWORD=hulab ---- set a password for rstudio, you can set your own password.

-it ---- Keep STDIN open even if not attached

--rm ---- Automatically remove the container when it exits

--cpus=4 ---- Number of cores will be used by docker. Make sure that your machine has more thread than the number here.

-v ---- Mount a folder to the container.

${PWD} ---- The current working directory.

/home/rstudio/work ---- The directory inside the docker image (the mounting point of the local folder in the docker image). Note that the docker container itself likes a mini virtual Linux system, so the file system inside it is Linux style.

-p ---- Publish a container’s port(s) to the host

hcp4715/rdock:fadpls ---- The docker image to run. Note that you should include the tag :fadpls part, otherwise docker will instead use "hcp4715/rdock:latest".

After running the code above, you shall see output as below:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] userconf: executing... 
[cont-init.d] userconf: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
...
⁠Step 4: Access Rstudio in browser.

Then, open your broswer (e.g., firefox, chrome), and try one of the following url in the address:

localhost:8787

http://192.168.99.100:8787

You will be asked to input username and password

Username: rstudio Password: hulab

Now, you will see the familiar interface of rstudio! In the browser!

⁠Step 4: test the image

Run the code below to test whether the image works

# load the libraries
library(tidyverse)

Tag summary

Content type

Image

Digest

sha256:a5e3389ef…

Size

1.1 GB

Last updated

over 3 years ago

docker pull hcp4715/rdock