Skip to content

Instantly share code, notes, and snippets.

@magnetikonline
Last active December 10, 2023 10:53
Show Gist options
  • Save magnetikonline/3b86355b5b4f951a732ea2072b6190b5 to your computer and use it in GitHub Desktop.
Save magnetikonline/3b86355b5b4f951a732ea2072b6190b5 to your computer and use it in GitHub Desktop.
Quick example for using the GitHub Container (Docker) registry.

Quick example for using the GitHub Container registry

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

Reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment