Because I had this error just now (October, 2017), but this thread was the first hit on the search engines when I searched for it, I thought it would be a good idea to return to this thread to answer the question.
The official Docker.app download doesn’t have this problem, but you will get it if you use homebrew’s docker (brew install docker). The solution in this case is to install docker-machine, or boot2docker. Boot2docker is deprecated, so I used docker-machine
brew install docker-machine
$(docker-machine env default)
This last line is needed in any shell that needs to interact with docker tools.
This fixed it up for me, and hopefully other folks who run in to this error.