Get Started with Azure Container Registry

Introduction:

What is Azure Container Registry (ACR)?
Azure container registry is a platform that stores and shares container images and associated artifacts. Docker Hub exemplifies a public container registry functioning as a comprehensive repository for Docker container images. Azure Container Registry, on the other hand, offers users precise management of their container content. It incorporates features like integrated authentication, global distribution through geo-replication for reliable network-close deployments, virtual network configuration via Private Link, tag locking, and various other advanced functionalities.
A repository within a registry comprises a grouping of container images or other artifacts sharing a common name but distinguished by different tags.
Repository names must solely consist of lowercase alphanumeric characters, periods, dashes, underscores, and forward slashes
Repository namespaces
Repository namespaces facilitate the sharing of a unified registry across various groups within your organization, allowing for shared access across deployments and teams. Azure Container Registry provides support for nested namespaces, allowing for group isolation. It’s important to note that while nested namespaces are supported, the registry treats each repository independently and does not establish a hierarchical structure.
Artifacts
Within a registry, a container image or another artifact is linked to one or more tags, consists of multiple layers, and is uniquely identified by a manifest. Grasping the interconnection of these components is essential for efficient registry management.
Tags:
The tag assigned to an image or another artifact serves as its version identifier. A repository can have a single artifact associated with one or multiple tags, and it can also be “untagged,” meaning that all tags are removed. At the same time, the underlying image data (layers) persists in the registry.
An image’s name is defined by the combination of the repository (or repository and namespace) and its tag. You can interact with an image during push or pull operations by specifying its name. If a tag is not provided in your Docker commands, the default tag “latest” is used.

Create Azure Container Registry:

Use below CLI command below to create an Azure container registry
az acr create --resource-group [your-resource-group] --Learning [registry-name] --sku Basic
These are three pricing plans in ACR

  1. Basic
  2. Standard
  3. Premium

For a demo, I picked a Basic plan

I have executed the below command to create an ACR in my environment

az acr create --resource-group Learning --name travelcontainerregistry --sku Basic

A basic plan is recommended for the development
Push Local Image to the ACR
Before pushing the image we should log in to the ACR
Use the below Command to login
az acr login --name <server-name>
In my case
az acr login --name travelcontainerregistry

Azure container login command

Tag the image

I have created a docker image from my local machine, which contains an asp.net core application.

Before pushing the local image to ACR we need to tag it, use the below command to tag the image

docker tag <localImageName> <login-server>/<repository-name:tagname>

my local images

In my case, I have used the below command

docker tag dockersampleapp travelcontainerregistry.azurecr.io/dockersampleapp:v1

Push the image

Use the below command to push the local image to ACR

docker push travelcontainerregistry.azurecr.io/dockersampleapp:v1

Image push command

local docker image successfully pushed to ACR

Azure Container Registry

Summary:

We have seen how to create an Azure container registry and how to push the local docker image into it. We will see more about the Azure container registry in my future article.

gowthamk91

Leave a Reply

Discover more from Gowtham K

Subscribe now to keep reading and get access to the full archive.

Continue reading