mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-03-11 04:14:38 +00:00
Add security note
This commit is contained in:
@@ -138,9 +138,11 @@ $ docker run -d \
|
||||
| 特性 | --mount | -v |
|
||||
|------|---------|-----|
|
||||
| 语法 | 键值对,更清晰 | 冒号分隔,更简洁 |
|
||||
| 自动创建卷 | source 不存在会报错 | 自动创建 |
|
||||
| 自动创建卷 | source 不存在会自动创建 | 自动创建 |
|
||||
| 推荐程度 | ✅ 推荐 (更明确)| 常用 (更简洁)|
|
||||
|
||||
> **提示**:很多人误以为 `--mount` 遇到目标不存在时总是报错。实际上,那仅适用于**绑定挂载 (Bind Mount)**。对于**数据卷 (Volume)**,只要 `source` 指定的卷名称不存在,Docker 都会默默将其创建出来。
|
||||
|
||||
#### 只读挂载
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user