Monthly Archives: August 2015

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.

Day 5 — Default and static interface methods in Java 8

We all understand that we should code to interfaces. Interfaces give client a contract which they should use without relying on the implementation details(i.e. classes). Hence, promoting loose coupling. Designing clean interfaces is one of the most important aspect of API design. One of the SOLID principle Interface segregation talks about designing smaller client-specific interfaces instead of designing one general purpose interface. Interface design is the key to clean and effective API’s for your libraries and applications. Continue reading