Fix cgroups, VOLUME, and tmpfs descriptions

This commit is contained in:
yeasy
2026-03-09 18:33:18 -07:00
parent 3d33e00802
commit a980e34276
3 changed files with 16 additions and 11 deletions

View File

@@ -10,16 +10,20 @@
### 8.3.2 基本用法
```bash
$ docker run --tmpfs /run:rw,noexec,nosuid,size=64m nginx
```
也可以使用 `--mount` 语法
使用 `--mount` 语法推荐
```bash
$ docker run --mount type=tmpfs,destination=/run,tmpfs-size=67108864 nginx
$ docker run --mount type=tmpfs,destination=/run,tmpfs-size=67108864,tmpfs-mode=1770 nginx
```
也可以使用 `--tmpfs` 简写语法
```bash
$ docker run --tmpfs /run:size=64m nginx
```
> **注意**`--tmpfs` 支持的选项有限主要为 `size` `mode`如果需要更精细的控制 `noexec``nosuid`推荐使用 `--mount` 语法并通过 `tmpfs-mode` 参数设置权限
### 8.3.3 注意事项
- 容器停止后`tmpfs` 数据会丢失