Azure Container Registry Operations: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
=External=
* https://docs.microsoft.com/en-us/azure/container-registry/container-registry-get-started-portal
=Internal=
=Internal=
* [[Azure Container Registry#Subjects|Azure Container Registry]]
* [[Azure Container Registry#Subjects|Azure Container Registry]]
Line 38: Line 40:
docker tag ovidiufeodorov/httpd:latest aksdev.azurecr.io/http:latest
docker tag ovidiufeodorov/httpd:latest aksdev.azurecr.io/http:latest
docker push aksdev.azurecr.io/http:latest
docker push aksdev.azurecr.io/http:latest
</syntaxhighlight>
=Import Image into the Registry=
{{External|https://docs.microsoft.com/en-us/azure/aks/cluster-container-registry-integration#import-an-image-into-your-acr}}
<syntaxhighlight lang='bash'>
az acr import  -n <acr-name> --source docker.io/library/nginx:latest --image nginx:v1
</syntaxhighlight>
=Configure AKS Integration with ACR=
This procedure integrates an ACR instance with an existing AKS cluster. For more details see: {{Internal|Azure_Container_Registry_Concepts#Pulling_Images_to_AKS|Azure Container Registry Concepts &#124; Pulling Images to AKS}}
==CLI==
<syntaxhighlight lang='bash'>
az aks update -n <aks-cluster-name> -g <aks-cluster-resource-group> --attach-acr <acr-name>|<acr-resource-id>
</syntaxhighlight>
Example:
<syntaxhighlight lang='bash'>
az aks update -n aks-dev -g aks-dev --attach-acr aksdevcr
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 01:47, 13 April 2021

External

Internal

Create

Portal

https://docs.microsoft.com/en-us/azure/container-registry/container-registry-get-started-portal

https://portal.azure.com/ → Create a Resource → Containers → Container Registry

Subscription:

Resource group → Create New

Registry name.

The name may contain only alpha numeric characters and be between 5 and 50 characters.

Name: aksdev.

Will be available as askdevcr.azurecr.io

CLI

Push an Image to Registry

Login. Specify only the registry name when logging in with the Azure CLI. Don't use the login server name, which includes a domain suffix like azurecr.io.

az acr login --name <registry-name>
az acr login --name aksdev

Then push an image available in the local docker cache, tag the image with a new name that contains the image of the login server and push:

docker tag <some-image> <login-server>/<image-name>[:tag]
docker push <login-server>/<image-name>[:tag]
docker tag ovidiufeodorov/httpd:latest aksdev.azurecr.io/http:latest
docker push aksdev.azurecr.io/http:latest

Import Image into the Registry

https://docs.microsoft.com/en-us/azure/aks/cluster-container-registry-integration#import-an-image-into-your-acr
az acr import  -n <acr-name> --source docker.io/library/nginx:latest --image nginx:v1

Configure AKS Integration with ACR

This procedure integrates an ACR instance with an existing AKS cluster. For more details see:

Azure Container Registry Concepts | Pulling Images to AKS

CLI

az aks update -n <aks-cluster-name> -g <aks-cluster-resource-group> --attach-acr <acr-name>|<acr-resource-id>

Example:

az aks update -n aks-dev -g aks-dev --attach-acr aksdevcr