Authenticate Podman to GitHub Container Registry
Why
Sometimes you want to push or pull container images from GitHub's container registry
How
Create a personal access token in GitHub and give it access to:
read:packages
if you are only pulling images, but if you plan to push and delete then add write:packages
and delete:packages
Export it as an environment variable
Podman login
I had an issue where this did not seem to work, so I had to take manual steps
Doing it our selves
Prepare the token and your username like the below
An example would be
base64 encode this
Insert the output in to the config file
Edit ~/.config/containers/auth.json
{
"auths": {
"docker.io": {
"auth": "dXNlcmJyYWRsZXk6YnJvX3N0b3BfaXQK"
},
"ghcr.io": {
"auth": "dXNlcmJyYWRsZXk6Z2hwX1N0b3BUcnlpbmdUb0ZpbmRNeUNyZWRlbnRpYWxzSG9taWUK"
}
}
}
Now you should be able to access ghcr
repos
Want to make this site better? Open a PR or help fund hosting costs