mirror of https://github.com/docker/cli.git
cli: add `--mount` to `docker run`
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
parent
d74d024775
commit
0e7bbb55c8
|
@ -1268,6 +1268,7 @@ _docker_container_run() {
|
|||
--memory-swap
|
||||
--memory-swappiness
|
||||
--memory-reservation
|
||||
--mount
|
||||
--name
|
||||
--network
|
||||
--network-alias
|
||||
|
|
|
@ -137,6 +137,7 @@ complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l link -d 'Add
|
|||
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)'
|
||||
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)'
|
||||
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)"
|
||||
complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l mount -d 'Attach a filesystem mount to the container'
|
||||
complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l name -d 'Assign a name to the container'
|
||||
complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l net -d 'Set the Network mode for the container'
|
||||
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'
|
||||
|
@ -328,6 +329,7 @@ complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l link -d 'Add li
|
|||
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)'
|
||||
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)'
|
||||
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)"
|
||||
complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l mount -d 'Attach a filesystem mount to the container'
|
||||
complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l name -d 'Assign a name to the container'
|
||||
complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l net -d 'Set the Network mode for the container'
|
||||
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'
|
||||
|
|
|
@ -1101,7 +1101,7 @@ __docker_service_subcommand() {
|
|||
"($help)--limit-memory=[Limit Memory]:value: "
|
||||
"($help)--log-driver=[Logging driver for service]:logging driver:__docker_log_drivers"
|
||||
"($help)*--log-opt=[Logging driver options]:log driver options:__docker_log_options"
|
||||
"($help)*--mount=[Attach a mount to the service]:mount: "
|
||||
"($help)*--mount=[Attach a filesystem mount to the service]:mount: "
|
||||
"($help)*--network=[Network attachments]:network: "
|
||||
"($help)--no-healthcheck[Disable any container-specified HEALTHCHECK]"
|
||||
"($help)*"{-p=,--publish=}"[Publish a port as a node port]:port: "
|
||||
|
@ -1481,6 +1481,7 @@ __docker_subcommand() {
|
|||
"($help)--log-driver=[Default driver for container logs]:logging driver:__docker_log_drivers"
|
||||
"($help)*--log-opt=[Log driver specific options]:log driver options:__docker_log_options"
|
||||
"($help)--mac-address=[Container MAC address]:MAC address: "
|
||||
"($help)*--mount=[Attach a filesystem mount to the container]:mount: "
|
||||
"($help)--name=[Container name]:name: "
|
||||
"($help)--network=[Connect a container to a network]:network mode:(bridge none container host)"
|
||||
"($help)*--network-alias=[Add network-scoped alias for the container]:alias: "
|
||||
|
|
|
@ -78,6 +78,7 @@ Options:
|
|||
--memory-reservation string Memory soft limit
|
||||
--memory-swap string Swap limit equal to memory plus swap: '-1' to enable unlimited swap
|
||||
--memory-swappiness int Tune container memory swappiness (0 to 100) (default -1)
|
||||
--mount value Attach a filesytem mount to the container (default [])
|
||||
--name string Assign a name to the container
|
||||
--network-alias value Add network-scoped alias for the container (default [])
|
||||
--network string Connect a container to a network (default "default")
|
||||
|
|
|
@ -84,6 +84,7 @@ Options:
|
|||
--memory-reservation string Memory soft limit
|
||||
--memory-swap string Swap limit equal to memory plus swap: '-1' to enable unlimited swap
|
||||
--memory-swappiness int Tune container memory swappiness (0 to 100) (default -1)
|
||||
--mount value Attach a filesystem mount to the container (default [])
|
||||
--name string Assign a name to the container
|
||||
--network-alias value Add network-scoped alias for the container (default [])
|
||||
--network string Connect a container to a network
|
||||
|
@ -255,6 +256,21 @@ Docker daemon.
|
|||
|
||||
For in-depth information about volumes, refer to [manage data in containers](https://docs.docker.com/engine/tutorials/dockervolumes/)
|
||||
|
||||
### Add bin-mounts or volumes using the --mounts flag
|
||||
|
||||
The `--mounts` flag allows you to mount volumes, host-directories and `tmpfs`
|
||||
mounts in a container.
|
||||
|
||||
The `--mount` flag supports most options that are supported by the `-v` or the
|
||||
`--volume` flag, but uses a different syntax. For in-depth information on the
|
||||
`--mount` flag, and a comparison between `--volume` and `--mount`, refer to
|
||||
the [service create command reference](service_create.md#add-bind-mounts-or-volumes).
|
||||
|
||||
Examples:
|
||||
|
||||
$ docker run --read-only --mount type=volume,target=/icanwrite busybox touch /icanwrite/here
|
||||
$ docker run -t -i --mount type=bind,src=/data,dst=/data busybox sh
|
||||
|
||||
### Publish or expose port (-p, --expose)
|
||||
|
||||
$ docker run -p 127.0.0.1:80:8080 ubuntu bash
|
||||
|
|
|
@ -38,7 +38,7 @@ Options:
|
|||
--log-driver string Logging driver for service
|
||||
--log-opt value Logging driver options (default [])
|
||||
--mode string Service mode (replicated or global) (default "replicated")
|
||||
--mount value Attach a mount to the service
|
||||
--mount value Attach a filesystem mount to the service
|
||||
--name string Service name
|
||||
--network value Network attachments (default [])
|
||||
--no-healthcheck Disable any container-specified HEALTHCHECK
|
||||
|
|
|
@ -53,6 +53,7 @@ docker-create - Create a new container
|
|||
[**--memory-reservation**[=*MEMORY-RESERVATION*]]
|
||||
[**--memory-swap**[=*LIMIT*]]
|
||||
[**--memory-swappiness**[=*MEMORY-SWAPPINESS*]]
|
||||
[**--mount**[=*MOUNT*]]
|
||||
[**--name**[=*NAME*]]
|
||||
[**--network-alias**[=*[]*]]
|
||||
[**--network**[=*"bridge"*]]
|
||||
|
|
|
@ -55,6 +55,7 @@ docker-run - Run a command in a new container
|
|||
[**--memory-reservation**[=*MEMORY-RESERVATION*]]
|
||||
[**--memory-swap**[=*LIMIT*]]
|
||||
[**--memory-swappiness**[=*MEMORY-SWAPPINESS*]]
|
||||
[**--mount**[=*MOUNT*]]
|
||||
[**--name**[=*NAME*]]
|
||||
[**--network-alias**[=*[]*]]
|
||||
[**--network**[=*"bridge"*]]
|
||||
|
|
Loading…
Reference in New Issue