Navigate back to the homepage

Github Container Registry

Nancy Chauhan
September 2nd, 2020 · 1 min read

Recently Github has made GitHub Container Registry free for public images.🤩 Easy to manage and easy to maintain! It has become super easy to push your 🐳 Docker images now. I recently worked on pushing one the docker image at my organisation and want to share a simple guide with you all. Here we go!

Authentication

  • Create a new personal access token (PAT) with following scopes :
    • read:packages
    • write:packages
    • delete:packages
  • Type this in your terminal:
    • export CR_PAT=YOUR_TOKEN
    • echo $CR_PAT | docker login ghcr.io -u USERNAME --password-stdin

Docker build and Push

After authenticating build the docker image and push it! Example :

  • docker build -t ghcr.io/nancy-chauhan/keystore:latest .
  • docker push ghcr.io/nancy-chauhan/keystore:latest

Example

Now if you are working for an organisation where you have a lot of private repositories. You can setup container registry to host your internal docker images. You can enforce access policies to control who can do what. Here is a consolidated list arranged by me, which you can refer and can quickly set up things.

References :

Thank you for reading!

More articles from Nancy Chauhan

Faster Builds with Docker Caching

Faster Builds with Docker caching

May 20th, 2020 · 1 min read

DNS Resolution

DNS acts as the phonebook of the internet 🌐. It converts a web address such as "example.com" to an IP address, which computers use to connect. As a result, we don't have to remember complicated IP addresses 🤩.

May 6th, 2020 · 2 min read
© 2018–2020 Nancy Chauhan
Link to $https://twitter.com/_nancychauhanLink to $https://github.com/Nancy-ChauhanLink to $https://www.linkedin.com/in/nancy-chauhan/Link to $https://www.instagram.com/_nancychauhan/Link to $https://medium.com/@_nancychauhan