GitHub recently released the GitHub Docker Container Registry, a competitor to the standard Docker Hub that lets you privately store Docker images in the cloud. It acts as an extension of GitHub packages and integrates with their existing CI / CD tools.
What is the GitHub Container Registry?
Docker container registers store built-in versions of Docker containers. The default is Docker Hub, which hosts most open source Docker containers. However, you are completely free to use another archive, and many companies choose to use a private register.
GitHub is in a particularly good position to offer a container registry, which is home to free open source software, and it̵7;s actually surprising that it took them so long to bring one to market. But it is here now and integrates quite well with its existing services, making it one of the best competitors to the Docker Hub available today.
The container register serves as an extension of GitHub Packages, a package repository for package managers such as NPM and NuGet. All they add is an option to use it for Docker images as well as support for Docker CLI tools like
The source code for the images, including Dockerfile, is all stored in a standard GitHub archive. Then, when you want to print an image, you can build it and shoot it to the associated image package for the repo.
Because both the source code and the Docker image are on GitHub, it provides a unique opportunity for integration. GitHub actions can be triggered by source code changes, which can automatically run builds of your image when changes are made to GitHub.
During the Container Registry beta, the container register will be free to use. Open source and public archives are always completely free to use, with
For private archives, the default billing rate for GitHub packages applies when the beta version is over. The free level includes 500 MB of storage and 1 GB of transfer per month, which should be enough for most projects. If not, you can invest in GitHub Teams or GitHub Enterprise.
How do you use it?
The URL of the new registry is
ghcr.io, easy to remember and short to type, which is a must when you need to print it for each Docker command.
To get started, you must first create a personal access token from Settings> Developer settings> Personal access token.
One of the best things you can do from here is create an automated CI / CD pipeline that builds your Docker image when changes are detected in Git. GitHub has a preventive measure called “Publish Docker Container” which will be published in the package register for the repository.
If you want to get started, you can read our guide to setting it up to learn more.
RELATED: How to set up automatic buildings for Docker images on GitHub