Cannot connect to the Docker daemon on macOS

前端 未结 15 1514
失恋的感觉
失恋的感觉 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条回答
  • On a supported Mac, run:

    brew cask install docker
    

    Then launch the Docker app. Click next. It will ask for privileged access. Confirm. A whale icon should appear in the top bar. Click it and wait for "Docker is running" to appear.

    You should be able to run docker commands now:

    docker ps
    

    Because docker is a system-level package, you cannot install it using brew install, and must use the cask instead.

    Note: This solution only works for Macs whose CPUs support virtualization, which may not include old Macs.

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

    I had docker up to date, docker said it was running, and the diagnosis was good. I needed to unset some legacy environment variable (thanks https://docs.docker.com/docker-for-mac/troubleshoot/#workarounds-for-common-problems )

    unset DOCKER_HOST
    unset DOCKER_CERT_PATH
    unset DOCKER_TLS_VERIFY
    
    0 讨论(0)
  • 2020-12-07 07:30

    I have Mac OS and I open Launchpad and select docker application. from reset tab click on restart.

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

    Try this to create default.

    docker-machine create default
    
    0 讨论(0)
  • 2020-12-07 07:33

    Install minikube and come join the dark side.

    https://kubernetes.io/docs/tasks/tools/install-minikube/

    $ bash --version
    GNU bash, version 5.0.3(1)-release (x86_64-apple-darwin18.2.0)
    Copyright (C) 2019 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    

    eval $(minikube docker-env)

    $ docker run --rm -v ${PWD}:/local swaggerapi/swagger-codegen-cli generate     -i /local/swagger.json     -l python     -o /local/test/
    [main] INFO io.swagger.parser.Swagger20Parser - reading from /local/swagger.json
    [main] WARN io.swagger.codegen.DefaultGenerator - 'host' not defined in the spec. Default to 'localhost'.
    

    Works great on Macbook Pro 2018 with bash v5. No need to install all the other docker nonsense these days IMO. The VM and install script that comes with minikube can replace docker machine from my experience.

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

    I was facing similar issue on my mac, and I found that docker wasn't running in my machine, I just went to applications and invoked whale and then it worked .

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