You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: contrib/completion/fish/docker.fish
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -138,6 +138,7 @@ complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l link -d 'Add
138
138
complete-c docker -A-f-n'__fish_seen_subcommand_from create'-s m -l memory -d'Memory limit (format: <number>[<unit>], where unit = b, k, m or g)'
139
139
complete-c docker -A-f-n'__fish_seen_subcommand_from create'-l mac-address -d'Container MAC address (e.g., 92:d0:c6:0a:29:33)'
140
140
complete-c docker -A-f-n'__fish_seen_subcommand_from create'-l memory-swap -d"Total memory usage (memory + swap), set '-1' to disable swap (format: <number>[<unit>], where unit = b, k, m or g)"
141
+
complete-c docker -A-f-n'__fish_seen_subcommand_from create'-l mount -d'Attach a filesystem mount to the container'
141
142
complete-c docker -A-f-n'__fish_seen_subcommand_from create'-l name -d'Assign a name to the container'
142
143
complete-c docker -A-f-n'__fish_seen_subcommand_from create'-l net -d'Set the Network mode for the container'
143
144
complete-c docker -A-f-n'__fish_seen_subcommand_from create'-s P -l publish-all -d'Publish all exposed ports to random ports on the host interfaces'
@@ -330,6 +331,7 @@ complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l link -d 'Add li
330
331
complete-c docker -A-f-n'__fish_seen_subcommand_from run'-s m -l memory -d'Memory limit (format: <number>[<unit>], where unit = b, k, m or g)'
331
332
complete-c docker -A-f-n'__fish_seen_subcommand_from run'-l mac-address -d'Container MAC address (e.g., 92:d0:c6:0a:29:33)'
332
333
complete-c docker -A-f-n'__fish_seen_subcommand_from run'-l memory-swap -d"Total memory usage (memory + swap), set '-1' to disable swap (format: <number>[<unit>], where unit = b, k, m or g)"
334
+
complete-c docker -A-f-n'__fish_seen_subcommand_from run'-l mount -d'Attach a filesystem mount to the container'
333
335
complete-c docker -A-f-n'__fish_seen_subcommand_from run'-l name -d'Assign a name to the container'
334
336
complete-c docker -A-f-n'__fish_seen_subcommand_from run'-l net -d'Set the Network mode for the container'
335
337
complete-c docker -A-f-n'__fish_seen_subcommand_from run'-s P -l publish-all -d'Publish all exposed ports to random ports on the host interfaces'
Copy file name to clipboardExpand all lines: docs/reference/commandline/run.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -95,6 +95,7 @@ Options:
95
95
--memory-reservation string Memory soft limit
96
96
--memory-swap string Swap limit equal to memory plus swap: '-1' to enable unlimited swap
97
97
--memory-swappiness int Tune container memory swappiness (0 to 100) (default -1)
98
+
--mount value Attach a filesystem mount to the container (default [])
98
99
--name string Assign a name to the container
99
100
--network-alias value Add network-scoped alias for the container (default [])
100
101
--network string Connect a container to a network
@@ -316,6 +317,29 @@ docker run -v c:\foo:c:\existing-directory-with-contents ...
316
317
317
318
For in-depth information about volumes, refer to [manage data in containers](https://docs.docker.com/engine/tutorials/dockervolumes/)
318
319
320
+
321
+
### Add bind-mounts or volumes using the --mount flag
322
+
323
+
The `--mount` flag allows you to mount volumes, host-directories and `tmpfs`
324
+
mounts in a container.
325
+
326
+
The `--mount` flag supports most options that are supported by the `-v` or the
327
+
`--volume` flag, but uses a different syntax. For in-depth information on the
328
+
`--mount` flag, and a comparison between `--volume` and `--mount`, refer to
329
+
the [service create command reference](service_create.md#add-bind-mounts-or-volumes).
330
+
331
+
Even though there is no plan to deprecate `--volume`, usage of `--mount` is recommended.
332
+
333
+
Examples:
334
+
335
+
```bash
336
+
$ docker run --read-only --mount type=volume,target=/icanwrite busybox touch /icanwrite/here
337
+
```
338
+
339
+
```bash
340
+
$ docker run -t -i --mount type=bind,src=/data,dst=/data busybox sh
*`src`, `source`: mount source spec for `bind` and `volume`. Mandatory for `bind`.
445
+
*`dst`, `destination`, `target`: mount destination spec.
446
+
*`ro`, `read-only`: `true` or `false` (default).
447
+
448
+
Options specific to `bind`:
449
+
450
+
*`bind-propagation`: `shared`, `slave`, `private`, `rshared`, `rslave`, or `rprivate`(default). See also `mount(2)`.
451
+
*`consistency`: `consistent`(default), `cached`, or `delegated`. Currently, only effective for Docker for Mac.
452
+
453
+
Options specific to `volume`:
454
+
455
+
*`volume-driver`: Name of the volume-driver plugin.
456
+
*`volume-label`: Custom metadata.
457
+
*`volume-nocopy`: `true`(default) or `false`. If set to `false`, the Engine copies existing files and directories under the mount-path into the volume, allowing the host to access them.
458
+
*`volume-opt`: specific to a given volume driver.
459
+
460
+
Options specific to `tmpfs`:
461
+
462
+
*`tmpfs-size`: Size of the tmpfs mount in bytes. Unlimited by default in Linux.
463
+
*`tmpfs-mode`: File mode of the tmpfs in octal. (e.g. `700` or `0700`.) Defaults to `1777` in Linux.
464
+
428
465
**--name**=""
429
466
Assign a name to the container
430
467
@@ -604,6 +641,9 @@ options are the same as the Linux default `mount` flags. If you do not specify
604
641
any options, the systems uses the following options:
605
642
`rw,noexec,nosuid,nodev,size=65536k`.
606
643
644
+
See also `--mount`, which is the successor of `--tmpfs` and `--volume`.
645
+
Even though there is no plan to deprecate `--tmpfs`, usage of `--mount` is recommended.
646
+
607
647
**-u**, **--user**=""
608
648
Sets the username or UID used and optionally the groupname or GID for the specified command.
609
649
@@ -704,6 +744,9 @@ change propagation properties of source mount. Say `/` is source mount for
704
744
To disable automatic copying of data from the container path to the volume, use
705
745
the `nocopy` flag. The `nocopy` flag can be set on bind mounts and named volumes.
706
746
747
+
See also `--mount`, which is the successor of `--tmpfs` and `--volume`.
748
+
Even though there is no plan to deprecate `--volume`, usage of `--mount` is recommended.
749
+
707
750
**--volume-driver**=""
708
751
Container's volume driver. This driver creates volumes specified either from
709
752
a Dockerfile's `VOLUME` instruction or from the `docker run -v` flag.
0 commit comments