az acr login failed
Related command
$> az acr login -n exampleacr You may want to use 'az acr login -n vmagentacr --expose-token' to get an access token, which does not require Docker to be installed. 2022-09-23 04:00:53.806011 An error occurred: DOCKER_COMMAND_ERROR Please verify if Docker client is installed and running.
Describe the bug
We have installed dockerCE at C:\Windows\System32\docker.exe by following document Get started: Prep Windows for containers, but az-cli can't find the location of docker-cli.
To Reproduce
1> create a windows VM
2> install dockerCE with script install-docker-ce.ps1
3> install az-cli latest version
4> run az acr login -n exampleacr --debug
cli.azure.cli.command_modules.acr.custom: Could not run 'docker' command. Exception: [WinError 2] The system cannot find the file specified
cli.azure.cli.command_modules.acr.custom: Could not run 'docker.exe' command. Exception: [WinError 2] The system cannot find the file specified
cli.azure.cli.command_modules.acr.custom: You may want to use 'az acr login -n vmagentacr --expose-token' to get an access token, which does not require Docker to be installed.
cli.azure.cli.core.util: azure.cli.core.util.handle_exception is called with an exception:
cli.azure.cli.core.util: Traceback (most recent call last):
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/acr/custom.py", line 354, in get_docker_command
File "subprocess.py", line 969, in __init__
File "subprocess.py", line 1438, in _execute_child
FileNotFoundError: [WinError 2] The system cannot find the file specified
Expected behavior
login succeeded.
Environment summary
az-cli version: 2.40.0 winver: windows server ltsc2019 (build 17763.3406)
Additional context
We find that az acr login could work if we create a symbol link of docker.exe at current dir.
Formerly it also works with either docker desktop or docker EE, so I guess any folder out of system32 in PATH should also work.
As a workaround, we use docker login exampleacr.azurecr.io -u exampleacr -p password instead.
route to CXP team
Adding Service team to look into this ask.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @toddysm, @luisdlp, @northtyphoon.
Issue Details
Related command
$> az acr login -n exampleacr You may want to use 'az acr login -n vmagentacr --expose-token' to get an access token, which does not require Docker to be installed. 2022-09-23 04:00:53.806011 An error occurred: DOCKER_COMMAND_ERROR Please verify if Docker client is installed and running.
Describe the bug
We have installed dockerCE at C:\Windows\System32\docker.exe by following document Get started: Prep Windows for containers, but az-cli can't find the location of docker-cli.
To Reproduce
1> create a windows VM
2> install dockerCE with script install-docker-ce.ps1
3> install az-cli latest version
4> run az acr login -n exampleacr --debug
cli.azure.cli.command_modules.acr.custom: Could not run 'docker' command. Exception: [WinError 2] The system cannot find the file specified
cli.azure.cli.command_modules.acr.custom: Could not run 'docker.exe' command. Exception: [WinError 2] The system cannot find the file specified
cli.azure.cli.command_modules.acr.custom: You may want to use 'az acr login -n vmagentacr --expose-token' to get an access token, which does not require Docker to be installed.
cli.azure.cli.core.util: azure.cli.core.util.handle_exception is called with an exception:
cli.azure.cli.core.util: Traceback (most recent call last):
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/acr/custom.py", line 354, in get_docker_command
File "subprocess.py", line 969, in __init__
File "subprocess.py", line 1438, in _execute_child
FileNotFoundError: [WinError 2] The system cannot find the file specified
Expected behavior
login succeeded.
Environment summary
az-cli version: 2.40.0 winver: windows server ltsc2019 (build 17763.3406)
Additional context
We find that az acr login could work if we create a symbol link of docker.exe at current dir.
Formerly it also works with either docker desktop or docker EE, so I guess any folder out of system32 in PATH should also work.
As a workaround, we use docker login exampleacr.azurecr.io -u exampleacr -p password instead.
| Author: | Kagamia-MS |
|---|---|
| Assignees: | - |
| Labels: |
|
| Milestone: | Backlog |
@toddysm, @luisdlp, @northtyphoon Could you please look into this issue and provide an update ? Thanks in advance.
any ETA on this ? It's coming up to almost a year now