Add docs for `run`/`create`/`build` command option `isolation`
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
| ... | ... |
@@ -25,6 +25,7 @@ parent = "smn_cli" |
| 25 | 25 |
-f, --file="" Name of the Dockerfile (Default is 'PATH/Dockerfile') |
| 26 | 26 |
--force-rm=false Always remove intermediate containers |
| 27 | 27 |
--help=false Print usage |
| 28 |
+ --isolation="" Container isolation technology |
|
| 28 | 29 |
-m, --memory="" Memory limit for all build containers |
| 29 | 30 |
--memory-swap="" Total memory (memory + swap), `-1` to disable swap |
| 30 | 31 |
--no-cache=false Do not use cache when building the image |
| ... | ... |
@@ -301,3 +302,19 @@ like `ENV` values do. |
| 301 | 301 |
|
| 302 | 302 |
For detailed information on using `ARG` and `ENV` instructions, see the |
| 303 | 303 |
[Dockerfile reference](../builder.md). |
| 304 |
+ |
|
| 305 |
+### Specify isolation technology for container (--isolation) |
|
| 306 |
+ |
|
| 307 |
+This option is useful in situations where you are running Docker containers on |
|
| 308 |
+Windows. The `--isolation=<value>` option sets a container's isolation |
|
| 309 |
+technology. On Linux, the only supported is the `default` option which uses |
|
| 310 |
+Linux namespaces. On Microsoft Windows, you can specify these values: |
|
| 311 |
+ |
|
| 312 |
+ |
|
| 313 |
+| Value | Description | |
|
| 314 |
+|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------| |
|
| 315 |
+| `default` | Use the value specified by the Docker daemon's `--exec-opt` . If the `daemon` does not specify an isolation technology, Microsoft Windows uses `process` as its default value. | |
|
| 316 |
+| `process` | Namespace isolation only. | |
|
| 317 |
+| `hyperv` | Hyper-V hypervisor partition-based isolation. | |
|
| 318 |
+ |
|
| 319 |
+Specifying the `--isolation` flag without a value is the same as setting `--isolation="default"`. |
| ... | ... |
@@ -43,6 +43,7 @@ Creates a new container. |
| 43 | 43 |
--help=false Print usage |
| 44 | 44 |
-i, --interactive=false Keep STDIN open even if not attached |
| 45 | 45 |
--ipc="" IPC namespace to use |
| 46 |
+ --isolation="" Container isolation technology |
|
| 46 | 47 |
--kernel-memory="" Kernel memory limit |
| 47 | 48 |
-l, --label=[] Set metadata on the container (e.g., --label=com.example.key=value) |
| 48 | 49 |
--label-file=[] Read in a line delimited file of labels |
| ... | ... |
@@ -125,3 +126,19 @@ then be used from the subsequent container: |
| 125 | 125 |
-rw-r--r-- 1 1000 staff 920 Nov 28 11:51 .profile |
| 126 | 126 |
drwx--S--- 2 1000 staff 460 Dec 5 00:51 .ssh |
| 127 | 127 |
drwxr-xr-x 32 1000 staff 1140 Dec 5 04:01 docker |
| 128 |
+ |
|
| 129 |
+### Specify isolation technology for container (--isolation) |
|
| 130 |
+ |
|
| 131 |
+This option is useful in situations where you are running Docker containers on |
|
| 132 |
+Windows. The `--isolation=<value>` option sets a container's isolation |
|
| 133 |
+technology. On Linux, the only supported is the `default` option which uses |
|
| 134 |
+Linux namespaces. On Microsoft Windows, you can specify these values: |
|
| 135 |
+ |
|
| 136 |
+ |
|
| 137 |
+| Value | Description | |
|
| 138 |
+|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------| |
|
| 139 |
+| `default` | Use the value specified by the Docker daemon's `--exec-opt` . If the `daemon` does not specify an isolation technology, Microsoft Windows uses `process` as its default value. | |
|
| 140 |
+| `process` | Namespace isolation only. | |
|
| 141 |
+| `hyperv` | Hyper-V hypervisor partition-based isolation. | |
|
| 142 |
+ |
|
| 143 |
+Specifying the `--isolation` flag without a value is the same as setting `--isolation="default"`. |
| ... | ... |
@@ -454,6 +454,14 @@ This example sets the `cgroupdriver` to `systemd`: |
| 454 | 454 |
|
| 455 | 455 |
Setting this option applies to all containers the daemon launches. |
| 456 | 456 |
|
| 457 |
+Also Windows Container makes use of `--exec-opt` for special purpose. Docker user |
|
| 458 |
+can specify default container isolation technology with this, for example: |
|
| 459 |
+ |
|
| 460 |
+ $ docker daemon --exec-opt isolation=hyperv |
|
| 461 |
+ |
|
| 462 |
+Will make `hyperv` the default isolation technology on Windows, without specifying |
|
| 463 |
+isolation value on daemon start, Windows isolation technology will default to `process`. |
|
| 464 |
+ |
|
| 457 | 465 |
## Daemon DNS options |
| 458 | 466 |
|
| 459 | 467 |
To set the DNS server for all Docker containers, use |
| ... | ... |
@@ -42,6 +42,7 @@ parent = "smn_cli" |
| 42 | 42 |
--help=false Print usage |
| 43 | 43 |
-i, --interactive=false Keep STDIN open even if not attached |
| 44 | 44 |
--ipc="" IPC namespace to use |
| 45 |
+ --isolation="" Container isolation technology |
|
| 45 | 46 |
--kernel-memory="" Kernel memory limit |
| 46 | 47 |
-l, --label=[] Set metadata on the container (e.g., --label=com.example.key=value) |
| 47 | 48 |
--label-file=[] Read in a file of labels (EOL delimited) |
| ... | ... |
@@ -546,3 +547,38 @@ the three processes quota set for the `daemon` user. |
| 546 | 546 |
The `--stop-signal` flag sets the system call signal that will be sent to the container to exit. |
| 547 | 547 |
This signal can be a valid unsigned number that matches a position in the kernel's syscall table, for instance 9, |
| 548 | 548 |
or a signal name in the format SIGNAME, for instance SIGKILL. |
| 549 |
+ |
|
| 550 |
+### Specify isolation technology for container (--isolation) |
|
| 551 |
+ |
|
| 552 |
+This option is useful in situations where you are running Docker containers on |
|
| 553 |
+Microsoft Windows. The `--isolation <value>` option sets a container's isolation |
|
| 554 |
+technology. On Linux, the only supported is the `default` option which uses |
|
| 555 |
+Linux namespaces. These two commands are equivalent on Linux: |
|
| 556 |
+ |
|
| 557 |
+``` |
|
| 558 |
+$ docker run -d busybox top |
|
| 559 |
+$ docker run -d --isolation default busybox top |
|
| 560 |
+``` |
|
| 561 |
+ |
|
| 562 |
+On Microsoft Windows, can take any of these values: |
|
| 563 |
+ |
|
| 564 |
+ |
|
| 565 |
+| Value | Description | |
|
| 566 |
+|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------| |
|
| 567 |
+| `default` | Use the value specified by the Docker daemon's `--exec-opt` . If the `daemon` does not specify an isolation technology, Microsoft Windows uses `process` as its default value. | |
|
| 568 |
+| `process` | Namespace isolation only. | |
|
| 569 |
+| `hyperv` | Hyper-V hypervisor partition-based isolation. | |
|
| 570 |
+ |
|
| 571 |
+In practice, when running on Microsoft Windows without a `daemon` option set, these two commands are equivalent: |
|
| 572 |
+ |
|
| 573 |
+``` |
|
| 574 |
+$ docker run -d --isolation default busybox top |
|
| 575 |
+$ docker run -d --isolation process busybox top |
|
| 576 |
+``` |
|
| 577 |
+ |
|
| 578 |
+If you have set the `--exec-opt isolation=hyperv` option on the Docker `daemon`, any of these commands also result in `hyperv` isolation: |
|
| 579 |
+ |
|
| 580 |
+``` |
|
| 581 |
+$ docker run -d --isolation default busybox top |
|
| 582 |
+$ docker run -d --isolation hyperv busybox top |
|
| 583 |
+``` |
| ... | ... |
@@ -12,6 +12,7 @@ docker-build - Build a new image from the source code at PATH |
| 12 | 12 |
[**--help**] |
| 13 | 13 |
[**-f**|**--file**[=*PATH/Dockerfile*]] |
| 14 | 14 |
[**--force-rm**[=*false*]] |
| 15 |
+[**--isolation**[=*default*]] |
|
| 15 | 16 |
[**--no-cache**[=*false*]] |
| 16 | 17 |
[**--pull**[=*false*]] |
| 17 | 18 |
[**-q**|**--quiet**[=*false*]] |
| ... | ... |
@@ -67,6 +68,9 @@ set as the **URL**, the repository is cloned locally and then sent as the contex |
| 67 | 67 |
**--force-rm**=*true*|*false* |
| 68 | 68 |
Always remove intermediate containers, even after unsuccessful builds. The default is *false*. |
| 69 | 69 |
|
| 70 |
+**--isolation**="*default*" |
|
| 71 |
+ Isolation specifies the type of isolation technology used by containers. |
|
| 72 |
+ |
|
| 70 | 73 |
**--no-cache**=*true*|*false* |
| 71 | 74 |
Do not use cache when building the image. The default is *false*. |
| 72 | 75 |
|
| ... | ... |
@@ -277,6 +281,19 @@ the system will look for that file inside the contents of the tarball. |
| 277 | 277 |
|
| 278 | 278 |
Note: supported compression formats are 'xz', 'bzip2', 'gzip' and 'identity' (no compression). |
| 279 | 279 |
|
| 280 |
+## Specify isolation technology for container (--isolation) |
|
| 281 |
+ |
|
| 282 |
+This option is useful in situations where you are running Docker containers on |
|
| 283 |
+Windows. The `--isolation=<value>` option sets a container's isolation |
|
| 284 |
+technology. On Linux, the only supported is the `default` option which uses |
|
| 285 |
+Linux namespaces. On Microsoft Windows, you can specify these values: |
|
| 286 |
+ |
|
| 287 |
+* `default`: Use the value specified by the Docker daemon's `--exec-opt` . If the `daemon` does not specify an isolation technology, Microsoft Windows uses `process` as its default value. |
|
| 288 |
+* `process`: Namespace isolation only. |
|
| 289 |
+* `hyperv`: Hyper-V hypervisor partition-based isolation. |
|
| 290 |
+ |
|
| 291 |
+Specifying the `--isolation` flag without a value is the same as setting `--isolation="default"`. |
|
| 292 |
+ |
|
| 280 | 293 |
# HISTORY |
| 281 | 294 |
March 2014, Originally compiled by William Henry (whenry at redhat dot com) |
| 282 | 295 |
based on docker.com source material and internal work. |
| ... | ... |
@@ -32,6 +32,7 @@ docker-create - Create a new container |
| 32 | 32 |
[**--help**] |
| 33 | 33 |
[**-i**|**--interactive**[=*false*]] |
| 34 | 34 |
[**--ipc**[=*IPC*]] |
| 35 |
+[**--isolation**[=*default*]] |
|
| 35 | 36 |
[**--kernel-memory**[=*KERNEL-MEMORY*]] |
| 36 | 37 |
[**-l**|**--label**[=*[]*]] |
| 37 | 38 |
[**--label-file**[=*[]*]] |
| ... | ... |
@@ -159,6 +160,9 @@ two memory nodes. |
| 159 | 159 |
'container:<name|id>': reuses another container shared memory, semaphores and message queues |
| 160 | 160 |
'host': use the host shared memory,semaphores and message queues inside the container. Note: the host mode gives the container full access to local shared memory and is therefore considered insecure. |
| 161 | 161 |
|
| 162 |
+**--isolation**="*default*" |
|
| 163 |
+ Isolation specifies the type of isolation technology used by containers. |
|
| 164 |
+ |
|
| 162 | 165 |
**--kernel-memory**="" |
| 163 | 166 |
Kernel memory limit (format: `<number>[<unit>]`, where unit = b, k, m or g) |
| 164 | 167 |
|
| ... | ... |
@@ -287,6 +291,21 @@ This value should always larger than **-m**, so you should always use this with |
| 287 | 287 |
**-w**, **--workdir**="" |
| 288 | 288 |
Working directory inside the container |
| 289 | 289 |
|
| 290 |
+# EXAMPLES |
|
| 291 |
+ |
|
| 292 |
+## Specify isolation technology for container (--isolation) |
|
| 293 |
+ |
|
| 294 |
+This option is useful in situations where you are running Docker containers on |
|
| 295 |
+Windows. The `--isolation=<value>` option sets a container's isolation |
|
| 296 |
+technology. On Linux, the only supported is the `default` option which uses |
|
| 297 |
+Linux namespaces. On Microsoft Windows, you can specify these values: |
|
| 298 |
+ |
|
| 299 |
+* `default`: Use the value specified by the Docker daemon's `--exec-opt` . If the `daemon` does not specify an isolation technology, Microsoft Windows uses `process` as its default value. |
|
| 300 |
+* `process`: Namespace isolation only. |
|
| 301 |
+* `hyperv`: Hyper-V hypervisor partition-based isolation. |
|
| 302 |
+ |
|
| 303 |
+Specifying the `--isolation` flag without a value is the same as setting `--isolation="default"`. |
|
| 304 |
+ |
|
| 290 | 305 |
# HISTORY |
| 291 | 306 |
August 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
| 292 | 307 |
September 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
| ... | ... |
@@ -33,6 +33,7 @@ docker-run - Run a command in a new container |
| 33 | 33 |
[**--help**] |
| 34 | 34 |
[**-i**|**--interactive**[=*false*]] |
| 35 | 35 |
[**--ipc**[=*IPC*]] |
| 36 |
+[**--isolation**[=*default*]] |
|
| 36 | 37 |
[**--kernel-memory**[=*KERNEL-MEMORY*]] |
| 37 | 38 |
[**-l**|**--label**[=*[]*]] |
| 38 | 39 |
[**--label-file**[=*[]*]] |
| ... | ... |
@@ -253,6 +254,9 @@ redirection on the host system. |
| 253 | 253 |
'container:<name|id>': reuses another container shared memory, semaphores and message queues |
| 254 | 254 |
'host': use the host shared memory,semaphores and message queues inside the container. Note: the host mode gives the container full access to local shared memory and is therefore considered insecure. |
| 255 | 255 |
|
| 256 |
+**--isolation**="*default*" |
|
| 257 |
+ Isolation specifies the type of isolation technology used by containers. |
|
| 258 |
+ |
|
| 256 | 259 |
**-l**, **--label**=[] |
| 257 | 260 |
Set metadata on the container (e.g., --label com.example.key=value) |
| 258 | 261 |
|
| ... | ... |
@@ -772,6 +776,38 @@ weight by `--blkio-weight-device` flag. Use the following command: |
| 772 | 772 |
|
| 773 | 773 |
# docker run -it --blkio-weight-device "/dev/sda:200" ubuntu |
| 774 | 774 |
|
| 775 |
+## Specify isolation technology for container (--isolation) |
|
| 776 |
+ |
|
| 777 |
+This option is useful in situations where you are running Docker containers on |
|
| 778 |
+Microsoft Windows. The `--isolation <value>` option sets a container's isolation |
|
| 779 |
+technology. On Linux, the only supported is the `default` option which uses |
|
| 780 |
+Linux namespaces. These two commands are equivalent on Linux: |
|
| 781 |
+ |
|
| 782 |
+``` |
|
| 783 |
+$ docker run -d busybox top |
|
| 784 |
+$ docker run -d --isolation default busybox top |
|
| 785 |
+``` |
|
| 786 |
+ |
|
| 787 |
+On Microsoft Windows, can take any of these values: |
|
| 788 |
+ |
|
| 789 |
+* `default`: Use the value specified by the Docker daemon's `--exec-opt` . If the `daemon` does not specify an isolation technology, Microsoft Windows uses `process` as its default value. |
|
| 790 |
+* `process`: Namespace isolation only. |
|
| 791 |
+* `hyperv`: Hyper-V hypervisor partition-based isolation. |
|
| 792 |
+ |
|
| 793 |
+In practice, when running on Microsoft Windows without a `daemon` option set, these two commands are equivalent: |
|
| 794 |
+ |
|
| 795 |
+``` |
|
| 796 |
+$ docker run -d --isolation default busybox top |
|
| 797 |
+$ docker run -d --isolation process busybox top |
|
| 798 |
+``` |
|
| 799 |
+ |
|
| 800 |
+If you have set the `--exec-opt isolation=hyperv` option on the Docker `daemon`, any of these commands also result in `hyperv` isolation: |
|
| 801 |
+ |
|
| 802 |
+``` |
|
| 803 |
+$ docker run -d --isolation default busybox top |
|
| 804 |
+$ docker run -d --isolation hyperv busybox top |
|
| 805 |
+``` |
|
| 806 |
+ |
|
| 775 | 807 |
# HISTORY |
| 776 | 808 |
April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
| 777 | 809 |
based on docker.com source material and internal work. |