Skip to content

Commit b88dcd0

Browse files
Update to 45X in STEP and README.md
1 parent c1c32a3 commit b88dcd0

File tree

2 files changed

+101
-9
lines changed

2 files changed

+101
-9
lines changed

.github/steps/-step.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3
1+
45X

README.md

+100-8
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,114 @@ _Use GitHub Actions to publish your project to a Docker image._
1414
</header>
1515

1616
<!--
17-
<<< Author notes: Step 3 >>>
17+
<<< Author notes: Step 4 >>>
1818
Start this step by acknowledging the previous step.
1919
Define terms and link to docs.github.com.
2020
-->
2121

22-
## Step 3: Merge your changes
22+
## Step 4: Pull your image
2323

24-
_Let's get publishing! :heart:_
24+
_Now things are running! :sparkles:_
2525

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.
2727

28-
### :keyboard: Activity: Merge your changes
28+
:cook: While we wait for the build to finish, let's take care of a few prerequisites.
2929

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+
![screenshot personal access token creation page with boxes for repo (all), write:packages, and read:packages checked](https://user-images.githubusercontent.com/3250463/219254714-82bb1da5-33b1-491b-97c0-b25f51494f6a.png)
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+
![screenshot of the pull command on the GitHub package page](https://user-images.githubusercontent.com/3250463/219254981-9ff949fa-4d01-46e3-9e3d-b8ce3710c2a9.png)
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:
70+
- `docker pull ghcr.io/YOURNAME/publish-packages/game:TAG`
71+
1. Press **Enter**.
72+
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+
![screenshot of successful Docker image output](https://user-images.githubusercontent.com/3250463/219255178-3c943a6f-6c15-4f59-9002-228249b1c469.png)
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+
![screenshot of output from Docker image ls command: lists docker images, REPOSITORY TAG and docker URL](https://i.imgur.com/UAwRXiq.png)<!-- 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!_
109+
110+
<img src=https://octodex.github.com/images/collabocats.jpg alt=celebrate width=300 align=right>
111+
112+
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).
33125

34126
<footer>
35127

0 commit comments

Comments
 (0)