Skip to content

Instantly share code, notes, and snippets.

@jimbo8098
Created March 13, 2023 21:50
Show Gist options
  • Save jimbo8098/e8ba48effd17d3049d84b4a8a9de4602 to your computer and use it in GitHub Desktop.
Save jimbo8098/e8ba48effd17d3049d84b4a8a9de4602 to your computer and use it in GitHub Desktop.
A small login script which uses the Github CLI to log into GHCR instead of conventional tokens which must be made on the site.
#Install Github CLI
# Set the scopes used for the token
gh auth login -s read:packages,write:packages,delete:packages
# Read the token in and use it in the docker login call
gh auth token | docker login ghcr.io -u username --password-stdin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment