# How do I add GitHub Container Registry images in my application?

**URL:** https://community.replicated.com/t/how-do-i-add-github-container-registry-images-in-my-application/481
**Category:** Packaging an application
**Created:** [December 9, 2020, 9:43pm UTC](https://community.replicated.com/t/how-do-i-add-github-container-registry-images-in-my-application/481 "2020-12-09T21:43:07Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![todd](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.replicated.com/todd/32/318_2.png) [@todd](https://community.replicated.com/u/todd)
#### Post date: [December 9, 2020, 9:43pm UTC](https://community.replicated.com/t/how-do-i-add-github-container-registry-images-in-my-application/481/1 "2020-12-09T21:43:07Z")

</div>

The new GitHub Registry is different from the older **GitHub Packages Docker** registry (compare both [here](https://docs.github.com/en/free-pro-team@latest/packages/guides/migrating-to-github-container-registry-for-docker-images)), and must be enabled before it can be used. To enable the GitHub registry feature for either **personal** or **organization** accounts, follow [this guide](https://docs.github.com/en/free-pro-team@latest/packages/guides/enabling-improved-container-support#enabling-github-container-registry-for-your-personal-account).

Next, create a personal access token (PAT) that will allow traditional Docker login access to your new GitHub registry. To create a new PAT, follow [this guide](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token).

After those steps are done, authenticate to the GitHub registry and push a test image to verify that `Docker login` using the PAT works correctly.

**NOTE** : replace _GITHUB\_USERNAME_ with your GitHub ID

First, temporarily export the PAT token:

`export CR_PAT=<YOUR_PAT_HERE>`

Then authenticate to the GitHub registry:

`echo $CR_PAT | docker login ghcr.io -u GITHUB_USERNAME --password-stdin`

Next pull a small test image and push it to GitHub. This example uses **NGINX** :

`docker pull nginx`

Tag the NGINX image for GitHub:

`docker tag nginx ghcr.io/GITHUB_USERNAME/nginx:latest`

and push it to GitHub:

`docker push ghcr.io/GITHUB_USERNAME/nginx:latest`

If that works, simply configure the external registry in the [Vendor Portal](https://vendor.replicated.com/) to use GitHub.

 ![40%20PM](https://canada1.discourse-cdn.com/flex030/uploads/replicated/original/1X/08d31f581f540522a9c9a46c73e387e6542a4ec2.png)

The private NGINX image just pushed to GitHub is now available in a deployment as `ghcr.io/GITHUB_USERNAME/nginx`

 ![28%20PM](https://canada1.discourse-cdn.com/flex030/uploads/replicated/original/1X/eb72ef4e08290ff27f02cee160c6b3462d061e6f.png)

**References** :

- [GitHub Registry guide](https://docs.github.com/en/free-pro-team@latest/packages/guides/about-github-container-registry)
- [Pushing and Pulling GitHub images](https://docs.github.com/en/free-pro-team@latest/packages/guides/pushing-and-pulling-docker-images#authenticating-to-github-container-registry)
