Is there any way to login in azure cr using only docker login command?
To login to Azure container registry via docker without using Azure CLI.
Since docker login
requires a token, we need to manually obtain an Azure AD access token
using Postman.
Then exchange it for an ACR access token
, Refer this github doc to exchange the AAD tokens for an ACR refresh token and then use docker login
with that token.
Please refer this Msdoc to generate access token.
Refer this doc to know how to enable SSL Certificate Verification in Postman.
Now you can log in to ACR using Docker,
docker login
command with the refresh token,echo "<REFRESH_TOKEN>" | docker login <container-registry>.azurecr.io -u <CLIENT_ID> --password-stdin
Here I've successfully logged in via docker. Now you can pull your image.