-
Notifications
You must be signed in to change notification settings - Fork 0
Docker
angelauzelac10 edited this page Jan 21, 2023
·
6 revisions
- An instance of an image.
- the self-contained running system.
- There can be multiple containers derived from the same image.
- contains the blueprint of a container.
- In docker, the image is built from a Dockerfile
- Anything written on a container will be erased when the container is erased ( or crashes) but anything written on a filesystem that is separate from the container will persist even after a container is turned off.
- A volume is a way to associate data with a container that will persist even after the container maps a drive on the host system to a drive on the container.
- In the docker run command that creates our container, the statement:
-v ${PWD}:/home/rstudio/projects
maps the directory${PWD}
to the directory/home/rstudio/projects
on the container. Anything saved in/home/rstudio/projects
will actually be saved in${PWD}
- To create a container:
docker run -e PASSWORD=changeit --rm \ -v /Users/risserlin/bcb420_code:/home/rstudio/projects \ -p 8787:8787 \ risserlin/bcb420-base-image:winter2022
- Download and install docker desktop.
- Need additional updates: i. update linux kernel ii. in command prompt: wsl --install
- for additional updates: https://docs.microsoft.com/en-us/windows/wsl/install-win10#step-4---download-the-linux-kernel-update-package
- Make sure to restart system after updates
- launch docker desktop app.
- Open windows Power shell
- navigate to directory:
C:\Users\angel\BCB420
- Run the following command:
docker run -e PASSWORD=bcb420 --rm -v ${PWD}:/home/rstudio/projects -p 8787:8787 risserlin/bcb420-base-image:winter2022
- Note: type it in manually instead of copy and pasting - it didn't work when copy and pasting
On docker desktop now see all containers and can manage them.
Open RStudio by typing localhost:8787 in browser, type in username rstudio, password bcb420, open projects folder and make a new script. MA!
- Run the Docker image
- open localhost:8787
- make script - called first_script
- to install packages DESeq2 and pheatmap run: `if (!require("BiocManager", quietly = TRUE)){ install.packages("BiocManager") }
BiocManager::install("DESeq2")
if (!require("pheatmap", quietly = TRUE)){ install.packages("pheatmap") } ` 5. created script called compFoldChange
This work is licensed under a Creative Commons Attribution 4.0 International License.