Docker client on OSX

This PR is based on #2393. Please address it first.

Docker client fully functional on OSX with very minor changes