How do I start the docker daemon on macOS?
Question
I am using macOS 10.14.6 and docker info
shows me that the docker daemon is not running.
How do I start the docker daemon from terminal?
I have not found any information on doing so anywhere. On Linux you do something like sudo service docker stop
, but this is incompatible with MacOS.
Solution
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 anTSI connection
error. In that case rundocker-machine regenerate-certs default
- (
docker-machine restart
) # maybe needed docker run hello-world
These steps are based on information given in these two questions:
OTHER TIPS
An alternative solition which worked for me:
- remove docker and docker-compose installed by brew
- install Docker Desktop for Mac
- run it and pass admin credentials to start everything
It resolved issues with "docker deamon not running" as well as some other issues that the other answer didn't (e.g. 0.0.0.0
ports were not redirected with docker installed using brew and worked smoothly with Docker Desktop installation).