Cannot connect to the Docker daemon on macOS

前端 未结 15 1570
失恋的感觉
失恋的感觉 2020-12-07 07:23

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         


        
15条回答
  •  天涯浪人
    2020-12-07 07:52

    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.

提交回复
热议问题