Docker on OSX: Client Connection Error

If you have installed Docker 0.8 and set it up on OSX, you’ll notice it’s a bit rough. One issue you might run into is the following error:

$ docker version
Client version: 0.8.0
Go version (client): go1.2
Git commit (client): cc3a8c8
2014/02/06 22:50:31 dial unix /var/run/docker.sock: no such file or directory

The issue here is that you followed the installation instructions literally and ran export DOCKER_HOST=tcp:// in your shell. Unfortunately, that export does not persist so the next time you open a console the DOCKER_HOST variable is not set so the docker client does not know how to reach the server. If you either add it to your .bash_profile or run it again in the current shell you will see it work as expected:

$ docker version
Client version: 0.8.0
Go version (client): go1.2
Git commit (client): cc3a8c8
Server version: 0.8.0
Git commit (server): cc3a8c8
Go version (server): go1.2

Adding Routes in OSX

It’s surprisingly frustrating to add new routes to your networking configuration on OSX as the syntax is similar but slightly different from Linux. The correct format for OSX is:

sudo route -n add -net <range> <gateway> <mask>

so, for example:

sudo route -n add -net 192.168.32.0 192.168.2.1 255.255.224.0

To make sure your changes took effect print the entire routing table:

netstat -rn

Who are we?

Here at Fogstack, we believe that the next wave of technology will do more than just provide tools for people – it will do things for you. Imagine that your finance website does more than just let you trade stocks, it adjusts your portofolio for you based on market events. Imagine that instead of just a check engine light your car tells you when it’s developing problems that need to be fixed. Imagine a world where technology takes off some of the burden of everyday life so you have more time to do the things you love.

That’s the world we see and what we’re working to help make happen. Visit us at http://fogstack.com

This blog, however, is just our random thoughts on technology.