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

  1. 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 typed type nul > Dockerfile.

  2. 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/')"

  1. Run cat Docker file to run the script in Dockerfile.

Screen-Shot-2023-01-20-at-9-48-53-PM.png

  1. Create a container with your Docker image.
  • Build docker image with docker build -t bcb420_docker_hw .

Screen-Shot-2023-01-20-at-10-27-43-PM.png

  • 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

  1. 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.
  1. Push your Docker file and your basic RNotebook to your github repo.
  2. Log your progress in your journal.

Report issues and resolutions.

  1. 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.
  2. 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 dot docker build -t bcb420_docker_hw .
  3. 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