Docker Machine — dial tcp: i/o timeout error on Mac


Today, while trying to use Docker Machine to create a local docker host on my macbook I was greeted with an exception as shown below.

$ docker-machine create -d virtualbox dev
Creating CA: /Users/abc/.docker/machine/certs/ca.pem
Creating client certificate: /Users/abc/.docker/machine/certs/cert.pem
Image cache does not exist, creating it at /Users/abc/.docker/machine/cache...
No default boot2docker iso found locally, downloading the latest release...No default boot2docker iso found locally, downloading the latest release...
Error creating machine: Get https://api.github.com/repos/boot2docker/boot2docker/releases: dial tcp: i/o timeout
You will want to check the provider to make sure the machine and associated resources were properly removed.

I tried to clear the local docker cache by deleting ~/.docker directory but each time I got the same exception. After a bit of trial and error I found out that it is because of the non-resolvable DNS server in the network settings. You can view your DNS server by going to System Preference > Network > Your internet connection > DNS. Make sure you are using a valid DNS server name. In case you don’t know a valid DNS server then you can use Googles **8.8.8.8** server. Now, next time you will usedocker-machine create` command you will be able to successfully create a machine.

Leave a comment