Manually push to GitHub Container registry with Docker login
Today I wanted to manually push a Docker image I built locally to my github container registry for debugging purposes.
I built the image like so
Important to not forget the dot in the end to indicate that the Dockerfile resides in the current directory.
I had issues pushing the image to ghcr.io, however. I confirmed that I was logged in as the correct user through
But it still would not work. I needed to create a new personal access token under my Github user's developer settings, granting it the packages:write (and :delete) permissions.
Then I logged in to docker using this nifty command:
Finally, I could run
successfully.