mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-03-11 12:21:17 +00:00
Fix cgroups, VOLUME, and tmpfs descriptions
This commit is contained in:
@@ -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` 数据会丢失。
|
||||
|
||||
Reference in New Issue
Block a user