WSL2上からaz acr loginを使ったログインができない

sinden30610 0 Reputation points
2023-04-16T12:12:25.3966667+00:00

以下はどうすれば解決できますか? You may want to use 'az acr login -n xxxxxxxx --expose-token' to get an access token, which does not require Docker to be installed. 2023-04-16 10:19:53.603773 An error occurred: DOCKER_COMMAND_ERROR Please verify if Docker client is installed and running.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,472 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Andrei Barbu 2,576 Reputation points Microsoft Employee
    2023-04-17T05:14:15.7133333+00:00

    Hello sinden30610

    "az acr login -n <registry-name>" required Docker CLI and Docker daemon to be installed (and running). This is documented in the public documentation here: https://learn.microsoft.com/en-us/azure/container-registry/container-registry-authentication?tabs=azure-cli#individual-login-with-azure-ad

    "When you log in with az acr login, the CLI uses the token created when you executed az login to seamlessly authenticate your session with your registry. To complete the authentication flow, the Docker CLI and Docker daemon must be installed and running in your environment. az acr login uses the Docker client to set an Azure Active Directory token in the docker.config file. Once you've logged in this way, your credentials are cached, and subsequent docker commands in your session do not require a username or password."

    To successfully run "az acr login -n <registry-name>" you can:

    1 - Install Docker CLI and Docker daemon. Select the OS used from here: https://docs.docker.com/engine/install/. Most probably, if you're using WSL2, you will need https://docs.docker.com/desktop/install/windows-install/. If it's already installed, make sure to run it.

    2 - Add "--expose-token" parameter, which doesn't require Docker daemon, but with this, you won't be able to run commands that require the Docker daemon, like "docker pull" or "docker push". The most use case for "az acr login -n <registry-name> --expose-token" is to run scripts that require to be logged in to ACR, but doesn't require operations for which the Docker daemon is mandatory. More details here: https://learn.microsoft.com/en-us/azure/container-registry/container-registry-authentication?tabs=azure-cli#az-acr-login-with---expose-token I hope you will find this helpful. If it helped you, please Accept as an answer and Upvote it so it can help others.

    Thank you!