解决非root用户使用docker的办法
2017-02-18 12:56
447 查看
通常我们使用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组
重新启动docker服务(下面是CentOS7的命令)
当前用户退出系统重新登陆
su root
su franson
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
相关文章推荐
- Tomcat在非Root用户下使用80端口启动报错解决办法
- Linux无法使用userdel删除用户和组的解决办法
- hadoop用户使用svn时无法保存密钥的解决办法
- 【Docker安全】关于Docker使用root与非root用户的场景中的容器与host中的执行用户的研究
- 为DB2 新增加的用户不能直接使用db2命令的解决办法
- 转摘--MS SQL Server 2000 数据库使用备份还原造成的孤立用户和对象名‘xxx’无效的错误的解决办法
- 非root用户安装python第三方模块出现Permission denied的解决办法
- docker中使用systemctl启动服务报错的解决办法
- Windows使用docker打开新窗口error解决办法
- pipework docker无法使用ip netns命令解决办法
- linux新建用户在命令行下使用tag没有提示解决办法
- ubuntu下新建用户的终端不显示当前路径,不能用上下光标键得到使用过的命名解决办法
- 非root用户使用docker
- ubuntu下新建用户的终端不显示当前路径,不能用上下光标键得到使用过的命名解决办法
- 解决普通用户使用docker命令加sudo
- 解决普通用户无法使用docker命令的问题
- Linux 无法使用userdel 删除用户和组的解决办法
- SQL Server 数据库使用备份还原造成的孤立用户和对象名‘xxx’无效的错误的解决办法
- 遇到当试图还原 master 数据库时,必须以单用户模式使用 RESTORE DATABASE.的解决办法
- Docker使用非root用户