Create a new Personal access token with the following permissions:
delete:packages
read:packages
write:packages
Make a note/store the token returned.
Next, use the access token with docker login
, where USERNAME
is your GitHub username:
$ echo "YOUR_TOKEN" | docker login ghcr.io -u USERNAME --password-stdin
To push an image, where OWNER
is your username/organisation name:
$ docker tag IMAGE_NAME:TAG_NAME ghcr.io/OWNER/IMAGE_NAME:TAG_NAME
$ docker push ghcr.io/OWNER/IMAGE_NAME:TAG_NAME