Journal Entry #1: Docker - bcb420-2023/Helena_Jovic GitHub Wiki
Objective
- Build and run a base docker image using Dockerfile
- Create a basic RNotebook following a set of specifications and loading specific libraries
- Push changes to personal github repo
Time Management
Date Started: 2022-01-20
Date Completed: 2022-01-21
Estimated Time: 2 hours
Actual Time: 2.5 hours
Procedure
-
Create your own Docker image built from the course base docker image [bcb420-base-imag Links to an external site.](https://q.utoronto.ca/(https//hub.docker.com/repository/docker/risserlin/bcb420-base-image)e.
In the terminal, I navigated to my bcb420 folder and then typedtype nul > Dockerfile
. -
Add additional libraries to the image: DESeq2Links to an external site. pheatmapLinks to an external site.
Then I edited the Dockerfile with the following text:
FROM risserlin/bcb420-base-image
RUN R -e "BiocManager::install('DESeq2')"
RUN R -e "install.packages('pheatmap', dependencies=TRUE, repos='http://cran.rstudio.com/')"
- Run
cat Docker file
to run the script in Dockerfile.
- Create a container with your Docker image.
- Build docker image with
docker build -t bcb420_docker_hw .
- Run with
docker run -e PASSWORD=changeit --rm -v ${PWD}:/home/rstudio/projects -p 8787:8787 bcb420_docker_hw
Open up a browser and type localhost:8787 into the URL bar.
Username: rstudio
Password: changeit
- Create a basic RNotebook in the projects directory and do the following:
- create a 5 by 10 matrix of random integers
- define column names as cond1, cond2, cond3, cond4, cond5, ctrl1, ctrl2, ctrl3, ctrl4, ctrl5
- define row names as gene1, gene2, gene3 ...
- Compute the fold change for each gene.
- Push your Docker file and your basic RNotebook to your github repo.
- Log your progress in your journal.
Report issues and resolutions.
- Error message received "Unable to find image 'bcb420_docker_hw:latest' locally docker: Error response from daemon: pull access denied for bcb420_docker_hw, repository does not exist or may require 'docker login': denied: requested access to the resource is denied. SOLVED: Worked after setting up DockerFile.
- Error message when initially running
docker build -f '/Users/helenajovic/Desktop/bcb420_code/Dockerfile/bcb420_docker_hw'
. SOLVED: If already in project directory, just need to use a dotdocker build -t bcb420_docker_hw .
- Was unable to push changes from local host to GitHub repo due to authentication issues. Still troubleshooting. In the meantime, uploaded files manually to GitHub.
Result
- Used Dockerfile to build and run a docker image to the local host.
- Created an R Notebook and saved changes to GitHub repo