I normally prefer to manage my apps on my OSX with brew
I am able to install docker, docker-compose and docker-machine
docker --version
Docker versio
I had this same issue I solved it in the following steps:
docker-machine restart
Quit terminal (or iTerm2, etc, etc) and restart
eval $(docker-machine env default)
I also answered it here
This problem:
$ brew install docker docker-machine
$ docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
This apparently meant do the following:
$ docker-machine create default # default driver is apparently vbox:
Running pre-create checks...
Error with pre-create check: "VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path"
$ brew cask install virtualbox
…
$ docker-machine create default
# works this time
$ docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
$ eval "$(docker-machine env default)"
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
It finally works.
You can use the “xhyve” driver if you don’t want to install virtual box.
Also you can install the “docker app” (then run it) which apparently makes it so you don’t have to run some of the above. brew cask install docker
then run the app, see the other answers. But apparently isn't necessary per se.
Docker for Mac is deprecated. And you don't need Homebrew to run Docker on Mac. Instead you'll likely want to install Docker Desktop or, if already installed, make sure it's up-to-date and running, then attempt to connect to the socket again.