Working with Github package registry
See original GitHub issueHey so i’m currently stuck between v1 no longer working and v2 not working either.
I use the Github container registry in a private repo.
In v1 i used:
- uses: docker/build-push-action@v1
with:
username: ${{ github.actor }}
password: ${{ github.token }}
registry: docker.pkg.github.com
repository: <org-name>/<repo-name>/<app-name>
tag_with_ref: true
This worked great. However this is failing recently. I suspect a major update to docker happened cause I cannot even pull these images locally since it fails with the error:
Error response from daemon: mediaType in manifest should be 'application/vnd.docker.distribution.manifest.v2+json' not ''
In v2: I’m using the setup from the readme:
- run: echo ::set-env name=IMAGE_TAG::${GITHUB_REF:10}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to Registry
uses: docker/login-action@v1
with:
registry: docker.pkg.github.com
username: ${{ github.actor }}
password: ${{ github.token }}
- uses: docker/build-push-action@v2
with:
push: true
tags: <org-name>/<repo-name>/<app-name>:${{ env.IMAGE_TAG }}
secrets: |
GIT_AUTH_TOKEN=${{ github.token }}
This fails with:
failed to solve: rpc error: code = Unknown desc = server message: insufficient_scope: authorization failed
Is there anything i am missing here?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:15 (5 by maintainers)
Top Results From Across the Web
Working with a GitHub Packages registry
Learn how to use a supported GitHub Packages registry. Diagram showing packages support for Docker, Container registry, RubyGems, npm, Apache Maven. Working ......
Read more >Working with the npm registry - GitHub Docs
The GitHub Packages registry stores npm packages within your organization or ...
Read more >Introduction to GitHub Packages
GitHub Packages is a software package hosting service that allows you to host ... GitHub Packages supports, see "Working with a GitHub Packages...
Read more >Your packages, at home with their code - GitHub
Run your CI/CD with Actions, and install packages and images hosted on GitHub Packages or your preferred registry of record. Streamline your workflow....
Read more >Quickstart for GitHub Packages
Now that you've published the package, you'll want to use it as a dependency across your projects. For more information, see "Working with...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kyler-hyuna your issue looks like an authentication
401 Unauthorized
and maybetags
.If you’re planning on migrating to GitHub Container Registry,
read:packages
scope to download container images and read their metadata.write:packages
scope to download and upload container images and read and write their metadata.delete:packages
scope to delete container images.In your GitHub Actions workflow files, update the package URL from
https://docker.pkg.github.com
toghcr.io
.Add your new container registry authentication personal access token (PAT) as a GitHub Actions secret. GitHub Container Registry does not support using
GITHUB_TOKEN
for your PAT so you must use a different custom variable, such asCR_PAT
. For more information, see “Creating and storing encrypted secrets.”Updated build.yml
I hope you find this helpful. ✌🏽 @crazy-max @hiddeco @kyler-hyuna
This is only during the Beta, we’ll roll out support for this next.