内容简介:通常我们使用Docker的时候都是使用的root,官方说法如下:下面是使用非root用户操作的步骤:1、创建docker组
通常我们使用 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用户操作的步骤:
1、创建docker组
sudo groupadd docker
2、将当前用户加入docker组
sudo gpasswd -a ${USER} docker
3、重新启动docker服务(下面是CentOS7的命令)
sudo service docker restart 或 sudo systemctl restart docker
4、当前用户退出系统重新登陆
以上所述就是小编给大家介绍的《解决非root用户使用docker的办法》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
ACM国际大学生程序设计竞赛
俞勇 编 / 2012-12 / 29.00元
《ACM国际大学生程序设计竞赛:知识与入门》适用于参加ACM国际大学生程序设计竞赛的本科生和研究生,对参加青少年信息学奥林匹克竞赛的中学生也很有指导价值。同时,作为程序设计、数据结构、算法等相关课程的拓展与提升,《ACM国际大学生程序设计竞赛:知识与入门》也是难得的教学辅助读物。一起来看看 《ACM国际大学生程序设计竞赛》 这本书的介绍吧!