Docker-Compose can't connect to Docker Daemon

后端 未结 18 934
死守一世寂寞
死守一世寂寞 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 20:50

    One way to resolve this would be to first add your user to the docker group by running the following

    sudo usermod -aG docker $USER
    

    IMPORTANT: Remember to log out of your system (not just your terminal) and back in for this to take effect!

    0 讨论(0)
  • 2020-12-22 20:50

    I think it's because of right of access, you just have to write

    sudo docker-compose-deps.yml up
    
    0 讨论(0)
  • 2020-12-22 20:52

    in my case it is because the ubuntu permission,

    1. List item

    check permission by

    docker info 
    

    if they print problem permission, then use

    sudo chmod -R 777 /var/run/docker.sock
    
    0 讨论(0)
  • 2020-12-22 20:52

    For me the fix was to install a newer version (1.24) of docker-compose using this article.

    The previous version (1.17) was installed from ubuntu's default repository, but after installing a newer version I managed to launch the container. Hope it helps somebody.

    0 讨论(0)
  • 2020-12-22 20:53

    I had the same error, after 15 min of debugging. Turns out all it needs is a sudo :) Check out [Create a Docker group] here https://docs.docker.com/engine/installation/linux/ubuntulinux/ to get rid of the sudo prefix.

    0 讨论(0)
  • 2020-12-22 20:56

    I had this problem and did not want to mess things up using sudo. When investigating, I tried to get some info :

    docker info
    

    Surprinsingly, I had the following error :

    Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http:///var/run/docker.sock/v1.38/info: dial unix /var/run/docker.sock: connect: permission denied

    For some reason I did not have enough privileges, the following command solved my problem :

    sudo chown $USER /var/run/docker.sock
    

    Et voilà !

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