Author : MD TAREQ HASSAN | Updated : 2021/05/20

Prerequisites

Enable docker login to Azure Container Registry (ACR)

Notes:

Using Visual Studio

Using Azure CLI

#
# Login to ACR using Azure credentials
#
az acr login --name myacr

#
# Create image and push in a single command
#
az acr build --image myacr.azurecr.io/myapp:latest --registry myacr --file Dockerfile .

Using Docker Command


#
# docker login
#
# ACR push 
# id: myacr
# pass: xxxxxyyyyyzzzzz
#
docker login myacr.azurecr.io
myacr # Admin user name
xxxxxyyyyyzzzzz # Admin password


#
# docker image build
#
docker build --tag myacr.azurecr.io/myapp:latest .

#
# docker push
#
docker push myacr.azurecr.io/myapp:latest