Skip to content

Commit fa8dd15

Browse files
committed
add table for tmpfs mount options
Signed-off-by: Eric Ernst <eric_ernst@apple.com>
1 parent d5a9947 commit fa8dd15

1 file changed

Lines changed: 25 additions & 8 deletions

File tree

docs/volumes.md

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,8 @@ container stops, the mount and everything written to it are gone. You can't shar
154154
Use a `tmpfs` mount when you need high-performance storage and don't need the data to
155155
persist after the container stops.
156156
157-
Use either `--tmpfs` or `--mount type=tmpfs`. Both accept the `size` and `mode` options:
158-
`--tmpfs` takes them as a colon-separated suffix on the path, and `--mount` as
159-
comma-separated `key=value` pairs.
157+
Use either `--tmpfs` or `--mount type=tmpfs`. Both accept the `size` and `mode` options;
158+
see [Mount options](#mount-options) for the syntax each one takes.
160159
161160
Mount a `tmpfs` filesystem at `/tmpfsmount1` with `--tmpfs`:
162161
@@ -202,9 +201,9 @@ container run --rm --mount type=tmpfs,target=/tmpfsmount1,size=512M,mode=1777 al
202201

203202
## Mount options
204203

205-
Mount-time options go on `container run` or `container create`, using `--mount` or
206-
`--volume`; for `--tmpfs`, see [Tmpfs mounts](#tmpfs-mounts). Creation-time options go on
207-
`container volume create`, using `--opt`.
204+
Mount-time options go on `container run` or `container create`, using `--mount`,
205+
`--volume`, or `--tmpfs`. Creation-time options go on `container volume create`, using
206+
`--opt`.
208207

209208
### Options for `--mount`
210209

@@ -221,13 +220,31 @@ Mount-time options go on `container run` or `container create`, using `--mount`
221220

222221
### Options for `--volume`
223222

224-
`--volume` uses the colon-separated form `[source:]destination[:options]`. Use `ro` to
225-
mount read-only:
223+
`--volume` uses the colon-separated form `[source:]destination[:options]`, comma-separated
224+
if there is more than one:
226225

227226
```bash
228227
container run --rm --volume foo:/mnt/foo:ro alpine sh
229228
```
230229

230+
| Key | Values | Description |
231+
|---|---|---|
232+
| `ro` | key only, no value | Mount read-only. |
233+
234+
### Options for `--tmpfs`
235+
236+
`--tmpfs` uses the colon-separated form `destination[:options]`, comma-separated if there
237+
is more than one:
238+
239+
```bash
240+
container run --rm --tmpfs /tmpfsmount1:size=64M,mode=1777 alpine sh
241+
```
242+
243+
| Key | Values | Description |
244+
|---|---|---|
245+
| `size` | for example `512M`, `1G` | Upper bound on the guest memory the mount can consume. |
246+
| `mode` | octal, for example `1777` | Permission bits for the mount point, the same as `chmod`. |
247+
231248
### Options for `container volume create`
232249

233250
| Key | Values | Description |

0 commit comments

Comments
 (0)