-
Notifications
You must be signed in to change notification settings - Fork 30
/
individual_assignment3.Rmd
67 lines (51 loc) · 4.37 KB
/
individual_assignment3.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
title: "Individual assignment 3"
descriptions: |
Practice building Docker images
output:
distill::distill_article:
toc: true
---
## Practice building Docker images
The purpose of this assignment is to ensure that everyone gains hands-on practice on creating Docker images from `Dockerfile`s.
### Exercise instructions
1. Create a **public** repository on GitHub.com repo under your personal username called `dsci310-dockerfile-practice`. Select the option to create the repository with a `README` file.
2. Add a `Dockerfile` to it. This Dockerfile should extend the Jupyter team's `r-notebook` image. In particular, the `quay.io/jupyter/r-notebook:2023-11-19` image. This is the image you should refer to in the `FROM` statement in your Dockerfile.
- [Docs about the `jupyter/minimal-notebook` image](https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html#jupyter-r-notebook)
- [link to `jupyter/minimal-notebook` Dockerfile](https://github.com/jupyter/docker-stacks/blob/main/images/minimal-notebook/Dockerfile)
3. Add a Docker `RUN` command so that at least **two** new Python or R package is installed using `conda` when the Docker image is built from the `Dockerfile`. Ensure that you pin the version of the package you add.
4. Build your `Dockerfile` and test it locally.
5. Add a GitHub Actions workflow to automatically:
- build the image
- push it to DockerHub
- version the image and GitHub repo when changes are pushed to the Dockerfile.
We recommend doing this by:
- by clicking the Actions tab and selecting "Skip this and setup a workflow yourself"
- paste this workflow into the empty file: <https://github.com/ttimbers/dsci310-dockerfile-practice/blob/main/.github/workflows/docker-publish.yml> (also edit the name to edit the name of the file to be `docker-publish.yml` instead of `main.yml`).
- edit the workflow file on line 32 so that the Docker image will be pushed to your DockerHub user space (and not mine!)
- add your DockerHub username and password (naming them `DOCKER_USERNAME` and `DOCKER_PASSWORD`, respectively) as GitHub secret (Under Settings > Secrets and variables > Actions > New repository secret) to this repository for this to work.
- (As Needed): Make sure that the GitHub Actions workflow to build and publish the Docker image get triggered. The `docker-publish.yml` file can be be triggered by either:
- pushing a commit that changes the `Dockerfile`, or
- clicking on the Actions tab, and then click on the workflow .github/workflows/docker-publish.yml. You then should see a “Run workflow” button with a drop down menu, from that menu select “Run workflow” (this will trigger GitHub Actions to create a commit in your remote repository).
6. Add a `LICENSE` file that attributes the usage of my `docker-publish.yml`
file in your repository.
This means, you need to copy the `LICENSE` file contents from
<https://github.com/ttimbers/dsci310-dockerfile-practice/blob/main/LICENSE>
and include the text in your `LICENSE` file.
You also want to add a note in that file that this only covers the code you copied from me
(`docker-publish.yml`).
### Submission instructions
You will submit a PDF to Gradescope for individual assignment 3 that includes:
1. A link to the GitHub.com repository that you create for this assignment.
- You should name your GitHub.com repository `dsci310-dockerfile-practice`.
2. A the link to your Docker image on DockerHub. You should name your DockerHub repository `dsci310-dockerfile-practice`.
## Rubric
This assignment will be graded for completion as follows:
| Grade | Description |
| ----- | ----------------------------------------------------------------------------------- |
| -15% | There were issues with the links submitted that made it difficult to find the GitHub or DockerHub repository |
| -15% | The version is missing from the package that was added to the `Dockerfile` |
| -15% | There were authentication issues with publishing to Docker Hub. |
| -33% | No new package was added to the `Dockerfile` |
| -33% | Docker image was not built successfully by GitHub actions and published to DockerHub |
| -100% | Assignment was not completed (no GitHub repository was created, or the repository is missing the `Dockerfile`) |