I'm stuck at pushing Docker images to GitHub Container Repository

1.7k views Asked by At

I'm trying to push a Docker image to ghcr.io. But I'm stuck.

I have created an action on GitHub, that logs into ghcr.io using this code:

echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

And it passes as a successful step in my GitHub action. I see this response:

Login Succeeded

Then I try to push using this command:

docker push ghcr.io/organization_name/repository_name:latest

And my organization is private. It shows me this error:

denied: installation not allowed to Create organization package
Error: Process completed with exit code 1.

I go to ghcr.io to manually create the repository (just the way we do on Docker Hub), but it's navigation does not have a good UX, at least in my opinion. I click Get Started on their home page, and it takes me to docs page. And when I click Quick Start there, it shows a sample of publishing NPM package. There I see that you should go to your repositories container landing page but I see no link to click to navigate there or no menu item anywhere.

Also I can't find out how to create this package repository using docs

How should I proceed?

1

There are 1 answers

3
Sebastian P. On

It looks like you have not granted the right permission to the token. You need to give it the write:package permission (can be changed when you open the details of your personal access token).