Lesson 26: Introduction to Container Registries (Beyond Docker Hub)
While Docker Hub is essential for obtaining public base images, organizations often need private registries to securely store and manage their proprietary images.
What is a Container Registry?
A registry is a stateless, scalable application that stores and distributes container images.
Types of Registries:
- Public Registry (e.g., Docker Hub): Hosts official and community-contributed images.
- Private Cloud Registries: Integrated with major cloud providers, offering high security and speed:
- AWS ECR (Elastic Container Registry)
- Google GCR / Artifact Registry
- Azure ACR (Azure Container Registry)
- Self-Hosted Private Registries: Running your own private registry on internal infrastructure (e.g., using Docker Registry).
Why Use a Private Registry?
- Security: Only authorized users or services can pull the images.
- Control: Full control over image versions, vulnerability scanning, and retention policies.
- Speed (Internal): Faster access to images within your corporate network or cloud provider region.
The Image Naming Convention
To push an image to a registry other than Docker Hub, you must tag the image with the registry's hostname (or domain).
Standard Naming Syntax:
Example (AWS ECR):
123456789012.dkr.ecr.us-east-1.amazonaws.com/my-project/web-app:1.0