Skip to content

Commit 8ac2e1f

Browse files
committed
Add a FAQ for GHCR.
Addresses the questions from #3. Signed-off-by: Chad Metcalf <[email protected]>
1 parent 6a5eab1 commit 8ac2e1f

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Welcome. This is a simple example application to show a common Docker specific
66
GitHub Action setup. We have a Python Flask application that is built and
77
deployed in Docker containers using Dockerfiles and Docker Compose.
88

9+
## CI Setup
10+
911
We want to setup CI to test:
1012

1113
-[Every commit to `main`](https://github.com/metcalfc/docker-action-examples/blob/main/.github/workflows/main-ci.yml)
@@ -46,6 +48,38 @@ I'm not going to have GitHub Action manage the deployment side of this example.
4648
Mostly because I don't want to leave an Amazon ECS cluster running. But you can
4749
see a demo of this in one of my past streams: https://www.youtube.com/watch?v=RfQrgZFq_P0
4850

51+
## GitHub Container Registry FAQ
52+
53+
### Where does this `secret.GHCR_TOKEN` come from?
54+
55+
The secret isn't automatically populated. The original GitHub Packages container registry did use the automatically generated `GITHUB_TOKEN`. GitHub has said that support for that will be added to this new registry in the future.
56+
57+
<br>
58+
59+
<blockquote class="twitter-tweet"><p lang="en" dir="ltr">Support for Actions through GITHUB_TOKEN is coming.</p>&mdash; Bryan Clark (@clarkbw) <a href="https://twitter.com/clarkbw/status/1300853015113396225?ref_src=twsrc%5Etfw">September 1, 2020</a></blockquote>
60+
61+
<br>
62+
63+
For now you will need to create a GitHub Personal Access Token (PAT) which you can do by going here: https://github.com/settings/tokens
64+
65+
You'll need to create the PAT with the correct scopes which you can find here: https://docs.github.com/en/packages/getting-started-with-github-container-registry/migrating-to-github-container-registry-for-docker-images#authenticating-with-the-container-registry
66+
67+
Once you have the PAT you can create an action secret: https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets
68+
69+
You can call the secret whatever you want. But `GHCR_TOKEN` is what I used for the example above.
70+
71+
### I thought GHRC had anonymous pulls?
72+
73+
Its a beta product so the documentation doesn't really exist yet. If you dig around on
74+
[GitHub's Community site](https://github.community/tag/ghcr) you can find some answers.
75+
Thats a pain so here is what I've found.
76+
77+
`ghcr.io` is private by default. You'll notice in the [nightly.yml](.github/workflows/nightly.yml) I had to do a login to be able to pull the image.
78+
79+
You can see what packages you have by going here (change the username): https://github.com/USERNAME?tab=packages&visibility=private
80+
81+
You can make it public going to the packages settings (change the username and project name): https://github.com/users/USERNAME/packages/container/PROJECTNAME/settings
82+
4983
## Compose sample application
5084

5185
### Python/Flask application

0 commit comments

Comments
 (0)