7

I am trying to pull docker image from docker hub to azure following this docs on docker https://docs.docker.com/cloud/aci-integration/.

when I enter the command:

 docker login azure

I get the error:

Error response from daemon: Get https://azure/v2/: dial tcp: lookup azure: no such host

I am not behind any vpn or proxy. I have tried some of the solutions mentioned in other threads like adding 8.8.8.8 & 8.8.8.4 in my resolv.conf and restarting docker daemon. But those solutions did not work.

anoncgain
  • 375
  • 3
  • 14
  • Any updates on the question? Does it solve your problem? If it works for you please accept it. – Charles Xu May 28 '21 at 01:50
  • No, I could solve my problem with your answer. For now I stopped suing docker login azure command and instead use azure cli or portal. – anoncgain May 28 '21 at 02:20
  • The Azure CLI command also does the same thing that creates a credential of the ACR for your local docker. If it works well, then the local docker will also work well. There must be something wrong you made. – Charles Xu May 28 '21 at 02:28
  • I have had the same problem: `docker login azure` fails but `az login` works well. So it is clearly not a network problem. – guibar May 28 '21 at 04:35
  • Same problem here on ubuntu 20.04, use `az login` instead and it works as of 16/9/2021 – Jonathan Chow Sep 16 '21 at 17:58

3 Answers3

3

I am on Ubuntu 20.04 and I had the same problem. I fixed it by uninstalling the docker-compose package which ubuntu provided and using the install script as documented here. The Ubuntu package doesn't seem to have the Azure integration features built-in.

guibar
  • 435
  • 1
  • 5
  • 12
2

This indicates that you've missed one of the prerequisites. Most likely you are trying to run this from Docker CE rather than one of the Docker Desktop installs on Mac/Windows. Alternatively, replacing the docker binary with one from the docker-compose install should get this to work on Linux.

BMitch
  • 231,797
  • 42
  • 475
  • 450
  • I removed all the docker-ce packages, went to Docker Desktop and verified that docker was enabled for wsl. Closed and launched a new WSL terminal, and now it works. – Robert Sim Apr 16 '22 at 04:06
-1

The possible reason is that there is a policy or multiple policies in your network that block the traffic. So you can try to use another machine to log in to Azure or check the network.

Charles Xu
  • 29,862
  • 2
  • 22
  • 39
  • I had the same problem in ubuntu 20.04, the fact that I could login with `az login` but not `docker login azure` suggestes that network is not the root cause – Jonathan Chow Sep 16 '21 at 18:00