Cannot connect to the Docker daemon on macOS

前端 未结 15 1515
失恋的感觉
失恋的感觉 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:49

    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

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2020-12-07 07:55

    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.

    0 讨论(0)
提交回复
热议问题