当前位置: 首页 > news >正文

Ubuntu Docker安装运行出错Cannot connect to the Docker daemon

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

win10@iZ23a3096aqZ:~$ docker version
Client:
 Version:      1.11.2
 API version:  1.23
 Go version:   go1.5.4
 Git commit:   b9f10c9
 Built:        Wed Jun  1 21:47:50 2016
 OS/Arch:      linux/amd64
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
win10@iZ23a3096aqZ:~$ docker run hello-world
docker: Cannot connect to the Docker daemon. Is the docker daemon running on this host?.
See 'docker run --help'.

解决方法:

因为我是非root用户,因此需要让你的用户和docker同属于一个组(docker所在的组名一般为docker),可以用 usermod 命令添加到docker组

sudo usermod -aG docker win10

然后登出用户 ctrl+d

重新登陆

再运行一下 docker version

Welcome to Ubuntu 14.04.4 LTS (GNU/Linux 3.13.0-65-generic x86_64)
 
 * Documentation:  https://help.ubuntu.com/
 
Welcome to aliyun Elastic Compute Service!
 
Last login: Fri Jun 17 00:05:03 2016 from 222.44.84.3
win10@iZ23a3096aqZ:~$ docker version 
Client:
 Version:      1.11.2
 API version:  1.23
 Go version:   go1.5.4
 Git commit:   b9f10c9
 Built:        Wed Jun  1 21:47:50 2016
 OS/Arch:      linux/amd64
 
Server:
 Version:      1.11.2
 API version:  1.23
 Go version:   go1.5.4
 Git commit:   b9f10c9
 Built:        Wed Jun  1 21:47:50 2016
 OS/Arch:      linux/amd64

再跑一下hello world

win10@iZ23a3096aqZ:~$ docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
a9d36faac0fe: Pull complete 
Digest: sha256:e52be8ffeeb1f374f440893189cd32f44cb166650e7ab185fa7735b7dc48d619
Status: Downloaded newer image for hello-world:latest
 
Hello from Docker.
This message shows that your installation appears to be working correctly.
 
To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.
 
To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash
 
Share images, automate workflows, and more with a free Docker Hub account:
 https://hub.docker.com
 
For more examples and ideas, visit:
 https://docs.docker.com/engine/userguide/

参考:

http://www.leesven.com/2338.html

https://segmentfault.com/q/1010000005040763

http://blog.163.com/s2006203387@126/blog/static/533199572015111703735423/

http://www.docker.org.cn/book/install/run-docker-without-sudo-30.html

转载于:https://my.oschina.net/u/1260221/blog/799548

相关文章:

  • PSR-2
  • 对象转为json数据
  • Listview_简单使用_(Virtual)
  • NIO源码阅读
  • 上传和设置Mime类型
  • SAP S/4 HANA新变化-FI数据模型
  • 线程与异常
  • 【转载】一个优秀求职者应主动问的一些问题
  • 关于Flux,Vuex,Redux的思考
  • 文字跑马灯
  • 我掌握的linux防火墙知识
  • HttpResponseMessage 调用.net web api
  • CentOS下Samba文件服务器的安装与配置
  • 跟着百度学PHP[4]OOP面对对象编程-12-抽象类
  • 工作中用到的自定义控件
  • CentOS 7 修改主机名
  • download使用浅析
  • ES6系列(二)变量的解构赋值
  • Java多线程(4):使用线程池执行定时任务
  • JAVA之继承和多态
  • k个最大的数及变种小结
  • Laravel5.4 Queues队列学习
  • Netty 4.1 源代码学习:线程模型
  • Otto开发初探——微服务依赖管理新利器
  • python 学习笔记 - Queue Pipes,进程间通讯
  • Python语法速览与机器学习开发环境搭建
  • tensorflow学习笔记3——MNIST应用篇
  • webpack4 一点通
  • XForms - 更强大的Form
  • 精益 React 学习指南 (Lean React)- 1.5 React 与 DOM
  • 理清楚Vue的结构
  • 数据可视化之下发图实践
  • ​决定德拉瓦州地区版图的关键历史事件
  • # Swust 12th acm 邀请赛# [ A ] A+B problem [题解]
  • # Swust 12th acm 邀请赛# [ K ] 三角形判定 [题解]
  • # 飞书APP集成平台-数字化落地
  • #include<初见C语言之指针(5)>
  • (2/2) 为了理解 UWP 的启动流程,我从零开始创建了一个 UWP 程序
  • (Redis使用系列) Springboot 使用redis实现接口幂等性拦截 十一
  • (solr系列:一)使用tomcat部署solr服务
  • (十七)devops持续集成开发——使用jenkins流水线pipeline方式发布一个微服务项目
  • (五)网络优化与超参数选择--九五小庞
  • .jks文件(JAVA KeyStore)
  • .NET C#版本和.NET版本以及VS版本的对应关系
  • .net Stream篇(六)
  • .NET 使用 XPath 来读写 XML 文件
  • @Autowired 与@Resource的区别
  • @vue/cli脚手架
  • [ Linux Audio 篇 ] 音频开发入门基础知识
  • [Android]Android P(9) WIFI学习笔记 - 扫描 (1)
  • [Apio2012]dispatching 左偏树
  • [BUUCTF 2018]Online Tool
  • [C/C++]数据结构 堆的详解
  • [c++] 单例模式 + cyberrt TimingWheel 单例分析
  • [C++]Leetcode17电话号码的字母组合