You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+100-8
Original file line number
Diff line number
Diff line change
@@ -14,22 +14,114 @@ _Use GitHub Actions to publish your project to a Docker image._
14
14
</header>
15
15
16
16
<!--
17
-
<<< Author notes: Step 3 >>>
17
+
<<< Author notes: Step 4 >>>
18
18
Start this step by acknowledging the previous step.
19
19
Define terms and link to docs.github.com.
20
20
-->
21
21
22
-
## Step 3: Merge your changes
22
+
## Step 4: Pull your image
23
23
24
-
_Let's get publishing! :heart:_
24
+
_Now things are running! :sparkles:_
25
25
26
-
You can now [merge](https://docs.github.com/en/get-started/quickstart/github-glossary#merge)your changes!
26
+
Whoa, now things are running! This may take a few minutes. This might take a tiny amount of time, so grab your popcorn :popcorn: and wait for the build to finish before moving on.
27
27
28
-
### :keyboard: Activity: Merge your changes
28
+
:cook: While we wait for the build to finish, let's take care of a few prerequisites.
29
29
30
-
1. Merge your changes from `cd` into `main`. If you created the pull request in step 1, just open that PR and click on **Merge pull request**. If you did not create the pull request earlier, you can do it now by following the instructions in step 1.
31
-
1. (optional) Delete the branch `cd`.
32
-
1. Wait about 20 seconds then refresh this page (the one you're following instructions from). [GitHub Actions](https://docs.github.com/en/actions) will automatically update to the next step.
30
+
For ease of use and cross-platform compatibility (Windows, Mac, and Linux), we'll focus on Docker Desktop. Not to be confused, Docker Engine is the foundation for running containers while **[Docker Desktop](https://www.docker.com/blog/how-to-check-docker-version/)** bundles Docker Engine, a GUI, and a Virtual Machine in a _single installation_.
31
+
32
+
1. Install [Docker Desktop for Windows](https://docs.docker.com/desktop/install/windows-install/#install-docker-desktop-on-windows).
33
+
* If you're using Mac or Linux, locate the correct install steps at the previous link via the lefthand tree menu.
34
+
1. Open Docker Desktop and [briefly explore](https://docs.docker.com/desktop/use-desktop/).
35
+
1. For running `docker` commands, access the command-line terminal either via Bash, Git Bash, Windows Command Prompt or PowerShell.
36
+
37
+
:inbox_tray: To pull the Docker image, we need to log into Docker first.
38
+
39
+
Before we can use this Docker image, you will need to generate a [personal access token (classic)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) that contains the following permissions:
40
+
41
+
**Scopes for Personal Access Token (classic)**:coin:
42
+
- repo (all)
43
+
- write:packages
44
+
- read:packages
45
+
46
+

47
+
48
+
We will use this token to log in to Docker, and authenticate with the package.
49
+
50
+
1. Open your terminal (Bash or Git Bash recommended).
51
+
1. Use the following command to log in:
52
+
```bash
53
+
docker login ghcr.io -u USERNAME
54
+
```
55
+
1. Replace `USERNAME` with your GitHub username.
56
+
1. Enter your new Personal Access Token as the password.
57
+
1. Press **Enter**.
58
+
59
+
If everything went well, :crossed_fingers: you should see `Login Succeeded` in your terminal.
60
+
61
+
### :keyboard: Activity: Pull your image
62
+
63
+
1. Copy the `pull` command from the package instructions.
64
+
-:fire:_Tip: To reach this page, click the **Code** tab at the top of your repository. Then, find the navigation bar below the repository description, and click the **Packages** heading link_
65
+

66
+
- Or alternatively, in the following URL replace `YOURNAME`, `REPONAME`, and browse to `https://github.com/users/YOURNAME/packages?repo_name=REPONAME` and click on the package name
67
+
1. Replace `YOURNAME` with your GitHub username.
68
+
1. Replace `TAG` with the image tag.
69
+
1. Paste the `pull` command into your terminal. It should look something like this:
1. You should see output indicating that the pull was successful, like `Status: Downloaded newer image for ghcr.io/YOURNAME/publish-packages/game:TAG`.
73
+

74
+
1._We can't automatically verify this step for you, so please continue on to the next step below!_
75
+
<!--
76
+
<<< Author notes: Step 5 >>>
77
+
Start this step by acknowledging the previous step.
78
+
Define terms and link to docs.github.com.
79
+
-->
80
+
81
+
## Step 5: Run your image
82
+
83
+
_Nicely done grabbing your Docker image! :relaxed:_
84
+
85
+
Let's trying running it.
86
+
87
+
### :keyboard: Activity: Run your image
88
+
89
+
1. Find your image information by typing `docker image ls`.
90
+
<!-- This screenshot should be changed. -->
91
+
1. Use the following command to run a container from your image:
92
+
```bash
93
+
docker run -dp 8080:80 --rm <YOUR_IMAGE_NAME:TAG>
94
+
```
95
+
1. Replace `YOUR_IMAGE_NAME` with your image name under the `REPOSITORY` column.
96
+
1. Replace `TAG` with the image tag under the `TAG` column.
97
+
1. Press **Enter**.
98
+
1. If everything went well, you will see hash value as output on your screen.
99
+
1. Optionally, you can open [localhost:8080](http://localhost:8080) to see the page you just created.
100
+
1._We can't automatically verify this step for you, so please continue on to the next step below!_
101
+
<!--
102
+
<<< Author notes: Finish >>>
103
+
Review what we learned, ask for feedback, provide next steps.
104
+
-->
105
+
106
+
## Finish
107
+
108
+
_Congratulations friend, you've completed this course!_
Here's a recap of all the tasks you've accomplished in your repository:
113
+
114
+
- You wrote a workflow that sends a code through a continuous delivery pipeline.
115
+
- You built a fully deployable artifact.
116
+
- You did so using GitHub Actions and GitHub Packages!
117
+
118
+
### What's next?
119
+
120
+
- Publish your own packages from your projects.
121
+
- We'd love to hear what you thought of this course [in our discussion board](https://github.com/orgs/skills/discussions/categories/publish-packages).
122
+
-[Take another GitHub Skills course](https://github.com/skills).
123
+
-[Read the GitHub Getting Started docs](https://docs.github.com/en/get-started).
124
+
- To find projects to contribute to, check out [GitHub Explore](https://github.com/explore).
0 commit comments