Home About Me

Fixing GHCR Unauthorized Errors When Docker Pull Fails

An image can build successfully and still fail at pull time. In this case, docker pull from GHCR returned repeated Unauthorized errors, which blocked the image from being used in a tutorial.

Docker pull from GHCR returning an Unauthorized error

The fix is in the package settings on GitHub. Open a URL in this form:

https://github.com/orgs/[XXX]/packages/container/[YYY]/settings

Replace [XXX] with the GitHub username and [YYY] with the project name. For example, after forking, the repository became HowieHz/umami, so the settings page was:

https://github.com/orgs/HowieHz/packages/container/umami/settings

On that settings page:

  1. Go to the settings URL constructed above.
  2. Enter the project name in the designated field.
  3. Click the red button to save the change.

Package settings page for resolving the pull error Saving the package settings change

After the settings are updated, pulling the image should work without the Unauthorized error.