最近在Ubuntu上搭建vulhub环境时在运行:

ubuntu@ubuntu:docker-compose up -d

报错:

 

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

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.

在网上找了很多教程找解决方式,效果都不是很好,不过运气还不差有一个方法解决了这个问题:

1、将当前用户加入docker组

ubuntu@ubuntu:sudo gpasswd -a ${USER} docker

2、重启docker服务

ubuntu@ubuntu:sudo systemctl restart docker

3、切换会话

ubuntu@ubuntu:newgrp - docker

 

提示:本文并非原创,因为找了很多方法浪费了很多时间才解决的问题所以将原作者的文章做一个推广,给大家提供一个好的解决方法,如果原作者不同意请联系删除。

原文连接:https://www.cnblogs.com/360minitao/p/12179629.html

 

相关文章:

  • 2021-10-01
  • 2021-09-26
  • 2021-08-29
  • 2021-07-20
  • 2021-08-11
  • 2021-08-09
  • 2021-12-10
猜你喜欢
  • 2022-12-23
  • 2022-01-12
  • 2021-10-27
  • 2022-12-23
  • 2021-10-26
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案