Skip to content
Overview
In order to use our internal container images hosted on ghcr.io, you'll need to create a Personal Access Token (PAT) to access these images. This guide walks you through the steps to generate a PAT and use it to log in to the registry.
Step-by-Step Guide to Create a PAT for ghcr.io
Log In to GitHub:
- Go to GitHub and log in with your credentials.
Access Settings:
- Click on your profile picture in the top right corner.
- Select Settings from the dropdown menu.
Developer Settings:
- In the left sidebar, scroll down and click on Developer settings.
Personal Access Tokens:
- Click on Personal access tokens in the left sidebar.
- Then, select Tokens (classic).
Generate New Token:
- Click on the Generate new token button on your left.
- Then click on Generate new token (classic) from the dropdown
Set Token Name and Expiration:
- Give your token a descriptive name (e.g., "ghcr-login") and set an expiration time according to your needs.
Select Scopes:
- Check the following scopes:
read:packages
- to download packages.
- Check the following scopes:
Generate Token:
- Scroll down and click on the Generate token button.
Copy Your Token:
- After the token is generated, copy it immediately. You won’t be able to see it again.
Logging Into ghcr.io
To log in to the GitHub Container Registry using your PAT:
Open Terminal:
- Open your command line interface (Terminal, Command Prompt, etc.).
Run Docker Login Command in your terminal:
bashdocker login ghcr.io
- When prompted for your username, enter your GitHub username.
- For the password, paste the Personal Access Token you copied earlier.
Conclusion
Once logged in, you can now pull internal container images from the GitHub Container Registry as needed. Remember to keep your PAT secure and rotate it periodically for security best practices.
CHAT SAMMIAT