Docker version reports bad response from Docker engine

I had the issue when I woke up my computer from an overnight sleep.
After a computer reboot things started working again.

Also might be related to this known beta bug:

Docker.app sometimes uses 200% CPU after OS X wakes up from sleep mode. The issue is being investigated. The workaround is to restart Docker.app.