In this post, let's see how we can push a local docker image to an Azure Container Registry. For this post, I am using a very simple local docker image kube-weather:dev which I have created in my previous post: Deploying an ASP.NET Core Application On a Local Kubernetes Cluster.
First, let's create an Azure Container Registry (ACR). It's actually pretty straight forward, don't think any explanations are necessary.
Then we need to push our image. For that, we will be using Azure CLI and make sure you have Azure CLI installed.
First, let's create an Azure Container Registry (ACR). It's actually pretty straight forward, don't think any explanations are necessary.
Create an ACR |
Now then open up a PowerShell window and run the below command to login to Azure.
PS C:\Users\Jaliya> az login
PS C:\Users\Jaliya> az account show
PS C:\Users\Jaliya> az account set --subscription {id of the target subscription}
PS C:\Users\Jaliya> az acr login --name playground01 Login Succeeded
Now run the below command to create a new image of kube-weather:dev image.
PS C:\Users\Jaliya> docker tag kube-weather:dev playground01.azurecr.io/kube-weather:dev
Login server |
PS C:\Users\Jaliya> docker images REPOSITORY TAG IMAGE ID CREATED SIZE kube-weather dev d9cd7bec80e7 2 days ago 208MB playground01.azurecr.io/kube-weather dev d9cd7bec80e7 2 days ago 208MB
PS C:\Users\Jaliya> docker push playground01.azurecr.io/kube-weather:dev The push refers to repository [playground01.azurecr.io/kube-weather] 5f3ec39d44c0: Pushed b4ab3aec213b: Pushed 05682a6a4056: Pushed fcd021389694: Pushed 2c52aed6692d: Pushed c51868eee26f: Pushed 556c5fb0d91b: Pushed dev: digest: sha256:b2725ccbc89e9684e406d5a20213562f9908e93f402570821a98285bc8d9a81d size: 1790
ACR-Repositories |
Hope this helps.
Happy Coding.
Regards,
Jaliya
No comments:
Post a Comment