Kahibaro
Discord Login Register

Container registries

What Is a Container Registry?

A container registry is a service for storing, managing, and distributing container images. It plays a similar role to a “package repository” (like yum or apt), but for container images instead of OS packages.

At a high level, a registry provides:

In OpenShift and Kubernetes-based environments, virtually all workloads depend on one or more registries as the source of their images.

Registry vs Repository vs Image

These terms are related but distinct:

An image reference generally has the form:

$$
\texttt{[registry/]namespace/repository[:tag]|[@digest]}
$$

For example:

Types of Container Registries

Public Registries

These are accessible over the internet and often host open-source or publicly available images.

Common public registries:

Public registries are convenient for:

However, they raise considerations around:

Private Registries

Private registries are controlled by an organization and usually restricted to internal users and systems.

Examples:

Reasons to use private registries:

Built-In and Cluster-Local Registries

OpenShift includes an integrated image registry service that:

Cluster-local registries are especially useful for:

How Registries Store Images (Conceptual)

While the details are abstracted away from end users, some key ideas:

When you push an image:

  1. The client sends the manifest and layers.
  2. The registry checks which layers it already has.
  3. Only missing layers are uploaded.
  4. The registry associates the tag (:1.0, :latest, etc.) with the manifest.

When you pull an image, the registry:

  1. Returns the manifest for the tag.
  2. The client downloads the required layers.
  3. The client assembles the image locally.

Authentication, Authorization, and Access Control

Most non-public registries require authentication. Common mechanisms:

Authorization usually controls:

In automated environments (like OpenShift clusters):

Image Tags and Versioning

Tags act as human-friendly labels for specific image versions.

Common practices:

Important behaviors:

For reliability and reproducibility:

Basic Push and Pull Workflow (Conceptual)

While specific commands and tools are covered elsewhere, the general workflow with any registry is:

  1. Login (if required): authenticate to the registry.
  2. Tag a local image with the target registry and repository:
    • my-app:1.0registry.example.com/project/my-app:1.0
  3. Push the image:
    • The registry receives layers and manifest.
  4. Pull the image from another environment (e.g., OpenShift cluster):
    • Workloads reference registry.example.com/project/my-app:1.0 in their configuration.

In OpenShift:

Security and Compliance Aspects of Registries

Container registries are a central point for security and governance:

Organizations usually define policies such as:

Image Lifecycle and Cleanup

Registries can accumulate many image versions over time. Common lifecycle management practices:

In a typical pipeline:

  1. Image built and pushed to registry.example.com/dev/my-app:1.0.
  2. After tests pass, copy/promote to registry.example.com/stage/my-app:1.0.
  3. Once approved, promote to registry.example.com/prod/my-app:1.0.

Registry Integration in Cloud-Native and OpenShift Environments

In cloud-native architectures, registries are deeply integrated into:

In OpenShift specifically, common patterns include:

Summary

Container registries are the backbone of container-based workflows:

Views: 15

Comments

Please login to add a comment.

Don't have an account? Register now!