Last active
December 10, 2023 10:53
Revisions
-
magnetikonline revised this gist
Dec 10, 2023 . 1 changed file with 4 additions and 4 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 @@ -10,12 +10,12 @@ read:packages write:packages ``` Make a note of the access token returned. Next, use access token with `docker login`, where `USERNAME` is your GitHub username: ```sh $ echo "ACCESS_TOKEN" | docker login ghcr.io -u USERNAME --password-stdin ``` To push an image, where `OWNER` is your username/organisation name: @@ -39,4 +39,4 @@ Where a Container registry package has been shared to a GitHub repository, execu ## Reference - https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry - 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-a-registry-using-a-personal-access-token -
magnetikonline revised this gist
May 28, 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 @@ -33,7 +33,7 @@ Where a Container registry package has been shared to a GitHub repository, execu - name: Login to Container registry run: | echo "${{ secrets.GITHUB_TOKEN }}" | \ docker login ghcr.io -u "${{ github.actor }}" --password-stdin ``` ## Reference -
magnetikonline revised this gist
May 28, 2021 . 1 changed file with 14 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 @@ -1,5 +1,7 @@ # Quick example for using the GitHub Container registry ## Human user access Create a new [Personal access token](https://github.com/settings/tokens) with the following permissions: ``` @@ -23,6 +25,18 @@ $ docker tag IMAGE_NAME:TAG_NAME ghcr.io/OWNER/IMAGE_NAME:TAG_NAME $ docker push ghcr.io/OWNER/IMAGE_NAME:TAG_NAME ``` ## `docker login` within a GitHub Actions workflow Where a Container registry package has been shared to a GitHub repository, executred workflows within this repository now automatically gain access. From within a workflow run step: ```yaml - name: Login to Container registry run: | echo "${{ secrets.GITHUB_TOKEN }}" | \ docker login ghcr.io -u ${{ github.actor }} --password-stdin ``` ## Reference - https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry - 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 -
magnetikonline revised this gist
May 26, 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 @@ -18,7 +18,7 @@ $ echo "YOUR_TOKEN" | docker login ghcr.io -u USERNAME --password-stdin To push an image, where `OWNER` is your username/organisation name: ```sh $ docker tag IMAGE_NAME:TAG_NAME ghcr.io/OWNER/IMAGE_NAME:TAG_NAME $ docker push ghcr.io/OWNER/IMAGE_NAME:TAG_NAME ``` -
magnetikonline created this gist
May 26, 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,28 @@ # Quick example for using the GitHub Container registry Create a new [Personal access token](https://github.com/settings/tokens) with the following permissions: ``` delete:packages read:packages write:packages ``` Make a note/store the token returned. Next, use the access token with `docker login`, where `USERNAME` is your GitHub username: ```sh $ echo "YOUR_TOKEN" | docker login ghcr.io -u USERNAME --password-stdin ``` To push an image, where `OWNER` is your username/organisation name: ``` $ docker tag IMAGE_NAME:TAG_NAME ghcr.io/OWNER/IMAGE_NAME:TAG_NAME $ docker push ghcr.io/OWNER/IMAGE_NAME:TAG_NAME ``` ## Reference - https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry