Docker-Compose can't connect to Docker Daemon

后端 未结 18 936
死守一世寂寞
死守一世寂寞 2020-12-22 20:25

I am getting an error message saying I can\'t connect to the docker daemon. I have looked into other people\'s answers who have had similar issues but it hasn\'t helped. I

相关标签:
18条回答
  • 2020-12-22 21:10

    In my case your docker service might be stopped

    Command to start docker service:

    $ sudo systemctl start docker

    Command to verify if it start:

    $ sudo docker run hello-world

    0 讨论(0)
  • 2020-12-22 21:10

    I used Ubuntu 16.04 and found this problem too when I used docker-compose. I fixed it by running this command.

    $ sudo systemctl start docker
    $ sudo docker-compose build
    
    0 讨论(0)
  • 2020-12-22 21:11

    Is there slight possibility you deleted default machine? But, first check if all files are there (OSX, similar on other systems)

    brew install docker docker-compose docker-machine xhyve docker-machine-driver-xhyve
    brew link docker docker-compose docker-machine xhyve docker-machine-driver-xhyve
    
    sudo chown root:wheel /usr/local/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
    sudo chmod u+s /usr/local/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
    

    Also, install Docker App, as it much easier to maintain containers:

    brew cask reinstall docker
    

    ans start Docker app from finder (wait until service is fully started)

    Then, check instalation with:

    docker-machine ls
    

    if no machines are present in list, create one and start it:

    docker-machine create default
    docker-machine start default
    

    After this, build, compose and all other commands should work properly.

    0 讨论(0)
  • 2020-12-22 21:13

    just try with sudo. It seems like permission issue!

    sudo docker-compose -f docker-compose-deps.yml up -d
    

    it worked for me.

    0 讨论(0)
  • 2020-12-22 21:13

    Another reason why this error can show up: for me it was a malformed image-path definition in the docker-compose.yml:

      service:
        image: ${CONTAINER_REGISTRY_BASE}/my-service
       ...
    

    Lookis ok'ish first, but i had CONTAINER_REGISTRY_BASE=eu.gcr.io/my-project/ set on the env. Apparently the // in the image path caused this error.

    docker-compose: v.1.21.2
    docker: 18.03.1-ce
    
    0 讨论(0)
  • 2020-12-22 21:15

    I got this error when there were files in the Dockerfile directory that were not accessible by the current user. docker could thus not upload the full context to the daemon and brought the "Couldn't connect to Docker daemon at http+docker://localunixsocket" message.

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