Last active
October 27, 2025 17:07
-
-
Save yokawasa/841b6db379aa68b2859846da84a9643c to your computer and use it in GitHub Desktop.
Revisions
-
yokawasa revised this gist
Jan 17, 2022 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -43,6 +43,9 @@ you can do seamless access to containers from Actions workflows via the `GITHUB_ See [Upgrading a workflow that accesses ghcr.io](https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#upgrading-a-workflow-that-accesses-ghcrio) for more detail ## Associate a certain package to a repository - [Connecting a repository to a package](https://docs.github.com/en/packages/learn-github-packages/connecting-a-repository-to-a-package) ## REFERENCES - https://github.com/features/packages -
yokawasa revised this gist
Dec 1, 2021 . 1 changed file with 25 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # ghcr (GitHub Container Registry) quickstart ## CLI To push container images to ghcr, you need peronal access token (PAT) - see [how to create PAT](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) @@ -21,7 +21,29 @@ Login Succeeded docker tag mycontainer ghcr.io/yokawasa/myrepo/mycontainer:0.0.1 docker push ghcr.io/yokawasa/myrepo/mycontainer:0.0.1 ``` 4. inspect ```bash docker inspect ghcr.io/yokawasa/myrepo/mycontainer:0.0.1 ``` ## GitHub Actions you can do seamless access to containers from Actions workflows via the `GITHUB_TOKEN` > The Container registry supports the GITHUB_TOKEN for easy and secure authentication in your workflows. If your workflow is using a personal access token (PAT) to authenticate to ghcr.io, then we highly recommend you update your workflow to use the GITHUB_TOKEN. ```yaml - name: Log in to registry # This is where you will update the PAT to GITHUB_TOKEN run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin ``` See [Upgrading a workflow that accesses ghcr.io](https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#upgrading-a-workflow-that-accesses-ghcrio) for more detail ## REFERENCES - https://github.com/features/packages - [Upgrading a workflow that accesses ghcr.io](https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#upgrading-a-workflow-that-accesses-ghcrio) -
yokawasa revised this gist
Oct 3, 2021 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,8 @@ ## Setup GHCR To push container images to ghcr, you need peronal access token (PAT) - see [how to create PAT](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) 1. Get PAT (personal access token) Personal Settings > Developer settings > [Personal access tokens](https://github.com/settings/tokens) -
yokawasa revised this gist
Oct 3, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # ghcr (GitHub Container Registry) quickstart ## Setup GHCR -
yokawasa renamed this gist
Oct 3, 2021 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
yokawasa created this gist
Oct 3, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ # Tips on GHCR (GitHub Container Registry) ## Setup GHCR 1. Get PAT (personal access token) Personal Settings > Developer settings > [Personal access tokens](https://github.com/settings/tokens) 2. ghcr login test ```bash # echo $PAT | docker login ghcr.io -u <githubユーザ名> --password-stdin echo $PAT | docker login ghcr.io -u yokawasa --password-stdin Login Succeeded ``` 3. push ```bash docker tag mycontainer ghcr.io/yokawasa/myrepo/mycontainer:0.0.1 docker push ghcr.io/yokawasa/myrepo/mycontainer:0.0.1 ``` REFERENCES - https://github.com/features/packages