使用docker而无须加sudo
来源:互联网 发布:海康威视网络摄像头 编辑:程序博客网 时间:2024/05/16 18:39
The docker daemon always runs as the root user, and since Docker version 0.5.2, 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 so, by default, you can access it with sudo.
Starting in version 0.5.3, if you (or your Docker installer) create a Unix group called docker and add users to it, then the docker daemon will make the ownership of the Unix socket read/writable by the docker group when the daemon starts. The docker daemon must always run as the root user, but if you run the docker client as a user in the docker group then you don’t need to add sudo to all the client commands.
原文
从0.5.2开始docker的守护进程总是以root用户来运行。docker守护进程绑定的是Unix的socket而不是一个TCP端口。Unix的socket默认属于root用户,所以,使用docker时必须加上sudo。
从0.5.3开始,创建一个名为docker组,然后将用户加入这个组内。当docker守护进程启动时,它会把Unix的读写权限赋予docker组。这样,当你作为docker组内用户使用docker客户端时,你就无须使用sudo了。
# Add the docker group if it doesn't already exist. sudo groupadd docker # Add the connected user "${USER}" to the docker group. # Change the user name to match your preferred user. # You may have to logout and log back in again for # this to take effect. sudo gpasswd -a ${USER} docker # Restart the docker daemon. sudo service docker restart
- 使用docker而无须加sudo
- 如何使用docker不加sudo
- mac上用docker,不需要加sudo
- 如何免 sudo 使用 docker
- 无需sudo直接使用docker
- Ubuntu免sudo使用Docker
- 如何免 sudo 使用 docker
- 如何免 sudo 使用 docker
- 免sudo使用docker命令
- 如何免 sudo 使用 docker
- 如何使用Greenpois0n Linux而无须安装Linux
- 如何使用Greenpois0n Linux而无须安装Linux
- docker + sudo
- Docker必须使用sudo操作的解决方案
- Docker学习(二):不使用sudo执行Docker
- Docker学习日记(免sudo使用docker命令)
- docker免去sudo命令
- ubuntu下sudo通过NOPASSWD无须再输入密码
- Poj 3658 Artificial Lake(模拟)
- 核心DOM和html DOM的区别
- 1009. 说反话 (20)
- PAT-1122. Hamiltonian Cycle (25)
- 创建快捷方式——解决部分机型创建不了或图标文案不正确
- 使用docker而无须加sudo
- UI设计 认识色彩
- mysql中默认编码格式设置,mysql连接设置
- NGINX
- Bellman-Ford算法——解决负权边
- POJ 2840 Big Clock G++
- linux驱动:音频驱动(四)ASoc之machine设备
- bzoj1610
- 1010. 一元多项式求导 (25)