Skip to content

Commit 7f00ee0

Browse files
committed
非管理员使用docker
1 parent ccc1e1e commit 7f00ee0

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

Part_04/04《Docker》/文档/Docker.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,36 @@ systemctl disable firewalld
207207

208208

209209

210+
#### 3.5 非管理员运行docker
211+
212+
> 默认情况下,Docker 需要使用 root 或具有 sudo 权限的用户才能运行。如果希望非管理员用户运行 Docker,可以通过将用户添加到 docker 用户组来实现。
213+
214+
215+
216+
##### 3.5.1 创建Docker用户组
217+
218+
```shell
219+
sudo groupadd docker
220+
```
221+
222+
223+
224+
##### 3.5.2 将非管理员用户加入 Docker 用户组
225+
226+
```shell
227+
sudo usermod -aG docker your_username
228+
```
229+
230+
##### 3.5.3 重新加载组
231+
232+
```shell
233+
newgrp docker
234+
```
235+
236+
237+
238+
239+
210240

211241

212242
### 四、Docker的中央仓库【`重点`

0 commit comments

Comments
 (0)