WSL - 无法从 Azure 容器注册表登录或拉取图像

WSL - Can't login or pull image from an azure container registry

我已经设置好 WSL. And then installed docked following this tutorial 然后安装了 azure cli。 我可以从 windows 命令行登录;但我无法使用 bash

中的以下命令登录到 azure 容器注册表
$ az acr login --name $ACRNAME 

我收到以下错误

Error response from daemon: Get https://ACRNAME.azurecr.io/v2/: unauthorized: authentication required

如果我尝试通过

拉取图像
$ docker pull ${ACRNAME}.azurecr.io/image_name

得到同样的错误

Error response from daemon: Get https://ACRNAME.azurecr.io/v2/: unauthorized: authentication required

但我可以看到列表。以下命令returns list

$ az acr repository list -n $ACRNAME

我找到了 this closed issue 并将我的机器 DNS 服务器更改为 8.8.8.8 但没有任何进展。我错过了什么?

对于您的问题,您可能使用了错误的用户名和密码。因此,首先您可以检查您选择登录的用户名和密码。您可以在门户中获取信息:container->Access keys。

您可以从此文档中获取更多信息az acr with az acr check-name and az acr create