ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?


ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?

docker 每次都要sudo, 或者其他服務啟動的時候,提示上述的錯誤

  • 如果還沒有 docker group 就添加一個:

    sudo groupadd docker
  • 將用戶加入該 group 內。然后退出並重新登錄就生效啦。

    sudo gpasswd -a ${USER} docker
  • 重啟 docker 服務

    sudo service docker restart
  • 切換當前會話到新 group 或者重啟 X 會話

    newgrp - docker

 

 

 

  1. Run this command to download the current stable release of Docker Compose:

    sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose 

    To install a different version of Compose, substitute 1.24.0 with the version of Compose you want to use.

    If you have problems installing with curl, see Alternative Install Options tab above.

  2. Apply executable permissions to the binary:

    sudo chmod +x /usr/local/bin/docker-compose 

Note: If the command docker-compose fails after installation, check your path. You can also create a symbolic link to /usr/bin or any other directory in your path.

For example:

sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose 
  1. Optionally, install command completion for the bash and zsh shell.

  2. Test the installation.

    $ docker-compose --version docker-compose version 1.24.0, build 1110ad01


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM