28

I am trying to resolve this network issue which I am facing multiple time while performing any docker commands like "Docker search Ubuntu".
I get an error saying:

"Error response from daemon: server misbehaving.

Can anyone help me on this?

BRap
  • 486
  • 2
  • 10
  • 24
Abhishek Pandey
  • 281
  • 1
  • 3
  • 4

4 Answers4

19

For those who have this problem, it is typically related to having an issue with your DNS being unable to resolve index.docker.io. I had this issue today working from home where my internet connection has a default DNS server that is notoriously flakey.

My dev environment is OSX and I easily solved the issue by changing my DNS servers in network settings to Google's DNS servers (8.8.8.8 and 8.8.4.4) and then restarting my docker host through docker-machine restart MACHINENAME

Ian Belcher
  • 5,083
  • 2
  • 32
  • 42
9

Faster/Easier Solution: login to docker-machine and fix the dns.

Turns out you don't have to go to all the trouble and waiting associated with restarting docker-machine. Just login to the docker machine (i.e. docker-machine ssh default) and edit /etc/resolv.conf - Add the dns settings from your host machine at the top of resolv.conf.

This is more or less what happens when you restart docker-machine and explains why some repositories are unreachable sometimes after you switch networks.

Matt Friedman
  • 1,495
  • 1
  • 17
  • 23
2

I also had the exact same problem. Then I stopped the docker-machine and started it--it worked.

Paba
  • 1,045
  • 2
  • 18
  • 33
0

Make sure that, when you run this, you are connected to the internet, as Docker needs to be able to do this.

George Ogden
  • 398
  • 4
  • 11