今天按照这个教程使用WSL安装docker时遇到了个问题:

  • 使用命令:$ docker search mysql

  • 出现:Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

进一步测试发现其他命令也都不能使用

必应搜索一番之后找到了一些解决方案:例如这个博客

$ systemctl daemon-reload
$ sudo service docker restart
$ sudo service docker status

不过我在执行第一个命令时就出现了:

System has not been booted with systemd as init system (PID 1). Can't operate

后来找到了这个issue

@craigloewen-msft

"Instead of using sudo systemctl start docker use: sudo /etc/init.d/docker start , as of right now we do not have systemd in WSL 2."

尝试了sudo /etc/init.d/docker start启动docker之后便不再出现片头那个问题

参考资料

https://github.com/MicrosoftDocs/WSL/issues/457

https://www.runoob.com/docker/ubuntu-docker-install.html

https://www.cnblogs.com/mmzs/p/12090197.html

docker安装出现"Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?"的更多相关文章

  1. 【转载】Docker 安装后 报 Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? 解决办法

    Docker Docker 安装后 报 Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docke ...

  2. Docker未启动错误:Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

    此问题是因为Docker安装后未启动所致,执行以下命令启动docker: systemctl start docker.service 具体日志如下: Connecting to ... Connec ...

  3. Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

    Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? 是由 ...

  4. docker 报错: Cannot connect to the Docker daemon at unix:///var/run/docker.sock.

    最近在 Windows 子系统 WSL 上面安装了一个 ubuntu18.04, 安装完docker 跑 hello-world 的时候报错了 docker: Cannot connect to th ...

  5. Cannot connect to the Docker daemon at unix:///var/run/docker.sock.问题解决

    出现Cannot connect to the Docker daemon at unix:///var/run/docker.sock时,先用tail -5f /var/log/upstart/do ...

  6. docker search mysql Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

    1.docker search mysql 报错 [root@localhost usr]# docker search mysqlCannot connect to the Docker daemo ...

  7. docker报错Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

    docker报错Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon run ...

  8. php fpm安装curl后,nginx出现connect() to unix:/var/run/php5-fpm.sock failed (13: Permission denied)的错误

    这里选择直接apt-get安装,因为比起自己编译简单多了,不需要自己配置什么 #sudo apt-get install curl libcurl3 libcurl3-dev php5-curl 安装 ...

  9. 转connect() to unix:/var/run/php-fpm.sock failed (11: Resource temporarily unavailable)

    网站常出现502 bad gateway,程序没有问题. 根据nginx日志:connect() to unix:/var/run/php-fpm.sock failed (11: Resource ...

随机推荐

  1. Prometheus组件

    Prometheus组件 上一小节,通过部署Node Exporter我们成功的获取到了当前主机的资源使用情况.接下来我们将从Prometheus的架构角度详细介绍Prometheus生态中的各个组件 ...

  2. POJ 2947:Widget Factory 求同余方程

    Widget Factory Time Limit: 7000MS   Memory Limit: 65536K Total Submissions: 5173   Accepted: 1790 De ...

  3. Hadoop端口与界面

    NameNode:7180 Cloudera Manager集群管理界面: NameNode:50070 NameNode Web UI/数据管理界面:   NameNode:8020/9000 Ha ...

  4. js保留两位小数的数字格式化方法

    // 格式化数字(保留两位小数) numberFormat (num) { let percent = Number(num.toString().match(/^\d+(?:\.\d{0,2})?/ ...

  5. 吴裕雄--天生自然JAVAIO操作学习笔记:RandomAccessFile

    import java.io.File ; import java.io.RandomAccessFile ; public class RandomAccessFileDemo01{ // 所有的异 ...

  6. JuJu团队1月7号工作汇报

    JuJu团队1月7号工作汇报 JuJu 周六周日放假,所以空了两天~   Scrum 团队成员 今日工作 剩余任务 困难 飞飞 完成data process readme部分 实现三维Dense 无 ...

  7. Prometheus Operator 架构【转】

    本节讨论 Prometheus Operator 的架构.因为 Prometheus Operator 是基于 Prometheus 的,我们需要先了解一下 Prometheus. Prometheu ...

  8. 将证书添加到受信任的根证书存储失败,出现以下错误:访问控制列表(ACL)结构无效

    问题出现情景: 使用 vs2017 创建一个 ASP.NET Core Web 应用程序 -> Ctrl + F5 运行项目 选择是,但是添加证书失败,是什么原因导致的我不知道,有大佬的知道的话 ...

  9. 运行jar包中的main方法

    java -classpath jar包名.jar 包名.类名

  10. 挖矿程序minerd入侵分析和解决办法

    现在比特币的价格涨得很高,所以现在有黑客专门制造挖矿木马来诱导网友,从而达到控制电脑上的显卡来挖掘比特币.为什么木马要控制电脑中的显卡呢?因为显卡挖掘虚拟货币比特币的效率远比 CPU 要高.如果你是一 ...