How do I start the docker daemon on macOS?
The docker setup does not work as in a normal Linux machine, on a Mac it is much more complicated. But it can be done!


brew cask install docker virtualbox
brew install docker-machine
docker-machine create --driver virtualbox default
docker-machine restart 
eval "$(docker-machine env default)" # This might throw an TSI connection error. In that case run docker-machine regenerate-certs default
(docker-machine restart) # maybe needed 
docker run hello-world


These steps are based on information given in these two questions:


Cannot connect to the Docker daemon on macOS
Mac OS X sudo docker Cannot connect to the Docker daemon. Is the docker daemon running on this host?.