通常我们使用Docker的时候都是使用的root,官方说法如下

The docker daemon binds to a Unix socket instead of a TCP port. By default that Unix socket is owned by the user root and other users can access it with sudo. For this reason, docker daemon always runs as the root user. 
To avoid having to use sudo when you use the docker command, create a Unix group called docker and add users to it. When the docker daemon starts, it makes the ownership of the Unix socket read/writable by the docker group.

下面是使用非root用户操作的步骤

创建docker组

sudo groupadd docker

将当前用户加入docker组

sudo gpasswd -a ${USER} docker

重新启动docker服务(下面是CentOS7的命令)

sudo service docker restart或sudo systemctl restart docker

当前用户退出系统重新登陆

su root

su franson

运行docker命令

docker ps

最新文章

  1. Google Developing for Android 一 - 相关上下文介绍
  2. (2016 年) githup 博客地址 : https://github.com/JMWY/MyBlog
  3. Python 2.7.9 Demo - isinstance
  4. JS对于Android和IOS平台的点击响应的适配
  5. iOS企业应用Profile制作流程
  6. JS插件excanvas的使用方法
  7. Bone Collector------HDOJ杭电2602(纯01背包问题!!!!!!具体解释!)
  8. Delphi XE7中新并行库
  9. JSP之项目路径问题(${pageContext.request.contextPath},<%=request.getContextPath()%>以及绝对路径获取)
  10. canvas画布,时钟
  11. js常用的正则表达式
  12. SVN 错误收集
  13. e614. Setting the Initial Focused Component in a Window
  14. SQL 存储过程 超市小票打印
  15. Eclipse环境开发Teamcenter RAC
  16. centos shell编程4【分发系统】 服务器标准化 mkpasswd 生成密码的工具 expect讲解 expect传递参数 expect自动同步文件 expect指定host和要同步的文件 expect文件分发系统 expect自动发送密钥脚本 Linux脚本执行方式 第三十八节课
  17. ARCGIS 10.0破解版安装过程error 1606 和error 1316问题 及安装流程
  18. virtio是啥子
  19. 【Kruskal+贪心思想】BZOJ3624-[Apio2008]免费道路
  20. Terracotta设计原理分析--(部分内容来自官方描述)

热门文章

  1. Eclipse如何提高开发效率
  2. quicksort(java版)
  3. Spring Cache 笔记
  4. 多层嵌套的json数据
  5. Ubuntu16.04下安装Hive
  6. linux CentOS6.5 yum安装mysql 5.6
  7. Windows下Oracle的下载与安装
  8. Global一点小经验
  9. 如何高效的编写与同步博客 (.NET Core 小工具实现)
  10. hexo+github创建属于自己的博客