Skip to content

Commit 38ec5d8

Browse files
committed
Add docs for option --isolation
Add docs for `run`/`create`/`build` command option `isolation` Signed-off-by: Zhang Wei <[email protected]>
1 parent db6c4c9 commit 38ec5d8

File tree

7 files changed

+150
-0
lines changed

7 files changed

+150
-0
lines changed

docs/reference/commandline/build.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ parent = "smn_cli"
2525
-f, --file="" Name of the Dockerfile (Default is 'PATH/Dockerfile')
2626
--force-rm=false Always remove intermediate containers
2727
--help=false Print usage
28+
--isolation="" Container isolation technology
2829
-m, --memory="" Memory limit for all build containers
2930
--memory-swap="" Total memory (memory + swap), `-1` to disable swap
3031
--no-cache=false Do not use cache when building the image
@@ -301,3 +302,19 @@ like `ENV` values do.
301302

302303
For detailed information on using `ARG` and `ENV` instructions, see the
303304
[Dockerfile reference](../builder.md).
305+
306+
### Specify isolation technology for container (--isolation)
307+
308+
This option is useful in situations where you are running Docker containers on
309+
Windows. The `--isolation=<value>` option sets a container's isolation
310+
technology. On Linux, the only supported is the `default` option which uses
311+
Linux namespaces. On Microsoft Windows, you can specify these values:
312+
313+
314+
| Value | Description |
315+
|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
316+
| `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. |
317+
| `process` | Namespace isolation only. |
318+
| `hyperv` | Hyper-V hypervisor partition-based isolation. |
319+
320+
Specifying the `--isolation` flag without a value is the same as setting `--isolation="default"`.

docs/reference/commandline/create.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Creates a new container.
4343
--help=false Print usage
4444
-i, --interactive=false Keep STDIN open even if not attached
4545
--ipc="" IPC namespace to use
46+
--isolation="" Container isolation technology
4647
--kernel-memory="" Kernel memory limit
4748
-l, --label=[] Set metadata on the container (e.g., --label=com.example.key=value)
4849
--label-file=[] Read in a line delimited file of labels
@@ -125,3 +126,19 @@ then be used from the subsequent container:
125126
-rw-r--r-- 1 1000 staff 920 Nov 28 11:51 .profile
126127
drwx--S--- 2 1000 staff 460 Dec 5 00:51 .ssh
127128
drwxr-xr-x 32 1000 staff 1140 Dec 5 04:01 docker
129+
130+
### Specify isolation technology for container (--isolation)
131+
132+
This option is useful in situations where you are running Docker containers on
133+
Windows. The `--isolation=<value>` option sets a container's isolation
134+
technology. On Linux, the only supported is the `default` option which uses
135+
Linux namespaces. On Microsoft Windows, you can specify these values:
136+
137+
138+
| Value | Description |
139+
|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
140+
| `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. |
141+
| `process` | Namespace isolation only. |
142+
| `hyperv` | Hyper-V hypervisor partition-based isolation. |
143+
144+
Specifying the `--isolation` flag without a value is the same as setting `--isolation="default"`.

docs/reference/commandline/daemon.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,14 @@ This example sets the `cgroupdriver` to `systemd`:
454454

455455
Setting this option applies to all containers the daemon launches.
456456

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+
457465
## Daemon DNS options
458466

459467
To set the DNS server for all Docker containers, use

docs/reference/commandline/run.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ parent = "smn_cli"
4242
--help=false Print usage
4343
-i, --interactive=false Keep STDIN open even if not attached
4444
--ipc="" IPC namespace to use
45+
--isolation="" Container isolation technology
4546
--kernel-memory="" Kernel memory limit
4647
-l, --label=[] Set metadata on the container (e.g., --label=com.example.key=value)
4748
--label-file=[] Read in a file of labels (EOL delimited)
@@ -546,3 +547,38 @@ the three processes quota set for the `daemon` user.
546547
The `--stop-signal` flag sets the system call signal that will be sent to the container to exit.
547548
This signal can be a valid unsigned number that matches a position in the kernel's syscall table, for instance 9,
548549
or a signal name in the format SIGNAME, for instance SIGKILL.
550+
551+
### Specify isolation technology for container (--isolation)
552+
553+
This option is useful in situations where you are running Docker containers on
554+
Microsoft Windows. The `--isolation <value>` option sets a container's isolation
555+
technology. On Linux, the only supported is the `default` option which uses
556+
Linux namespaces. These two commands are equivalent on Linux:
557+
558+
```
559+
$ docker run -d busybox top
560+
$ docker run -d --isolation default busybox top
561+
```
562+
563+
On Microsoft Windows, can take any of these values:
564+
565+
566+
| Value | Description |
567+
|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
568+
| `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. |
569+
| `process` | Namespace isolation only. |
570+
| `hyperv` | Hyper-V hypervisor partition-based isolation. |
571+
572+
In practice, when running on Microsoft Windows without a `daemon` option set, these two commands are equivalent:
573+
574+
```
575+
$ docker run -d --isolation default busybox top
576+
$ docker run -d --isolation process busybox top
577+
```
578+
579+
If you have set the `--exec-opt isolation=hyperv` option on the Docker `daemon`, any of these commands also result in `hyperv` isolation:
580+
581+
```
582+
$ docker run -d --isolation default busybox top
583+
$ docker run -d --isolation hyperv busybox top
584+
```

man/docker-build.1.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ docker-build - Build a new image from the source code at PATH
1212
[**--help**]
1313
[**-f**|**--file**[=*PATH/Dockerfile*]]
1414
[**--force-rm**[=*false*]]
15+
[**--isolation**[=*default*]]
1516
[**--no-cache**[=*false*]]
1617
[**--pull**[=*false*]]
1718
[**-q**|**--quiet**[=*false*]]
@@ -67,6 +68,9 @@ set as the **URL**, the repository is cloned locally and then sent as the contex
6768
**--force-rm**=*true*|*false*
6869
Always remove intermediate containers, even after unsuccessful builds. The default is *false*.
6970

71+
**--isolation**="*default*"
72+
Isolation specifies the type of isolation technology used by containers.
73+
7074
**--no-cache**=*true*|*false*
7175
Do not use cache when building the image. The default is *false*.
7276

@@ -277,6 +281,19 @@ the system will look for that file inside the contents of the tarball.
277281

278282
Note: supported compression formats are 'xz', 'bzip2', 'gzip' and 'identity' (no compression).
279283

284+
## Specify isolation technology for container (--isolation)
285+
286+
This option is useful in situations where you are running Docker containers on
287+
Windows. The `--isolation=<value>` option sets a container's isolation
288+
technology. On Linux, the only supported is the `default` option which uses
289+
Linux namespaces. On Microsoft Windows, you can specify these values:
290+
291+
* `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.
292+
* `process`: Namespace isolation only.
293+
* `hyperv`: Hyper-V hypervisor partition-based isolation.
294+
295+
Specifying the `--isolation` flag without a value is the same as setting `--isolation="default"`.
296+
280297
# HISTORY
281298
March 2014, Originally compiled by William Henry (whenry at redhat dot com)
282299
based on docker.com source material and internal work.

man/docker-create.1.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ docker-create - Create a new container
3232
[**--help**]
3333
[**-i**|**--interactive**[=*false*]]
3434
[**--ipc**[=*IPC*]]
35+
[**--isolation**[=*default*]]
3536
[**--kernel-memory**[=*KERNEL-MEMORY*]]
3637
[**-l**|**--label**[=*[]*]]
3738
[**--label-file**[=*[]*]]
@@ -159,6 +160,9 @@ two memory nodes.
159160
'container:<name|id>': reuses another container shared memory, semaphores and message queues
160161
'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.
161162

163+
**--isolation**="*default*"
164+
Isolation specifies the type of isolation technology used by containers.
165+
162166
**--kernel-memory**=""
163167
Kernel memory limit (format: `<number>[<unit>]`, where unit = b, k, m or g)
164168

@@ -287,6 +291,21 @@ This value should always larger than **-m**, so you should always use this with
287291
**-w**, **--workdir**=""
288292
Working directory inside the container
289293

294+
# EXAMPLES
295+
296+
## Specify isolation technology for container (--isolation)
297+
298+
This option is useful in situations where you are running Docker containers on
299+
Windows. The `--isolation=<value>` option sets a container's isolation
300+
technology. On Linux, the only supported is the `default` option which uses
301+
Linux namespaces. On Microsoft Windows, you can specify these values:
302+
303+
* `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.
304+
* `process`: Namespace isolation only.
305+
* `hyperv`: Hyper-V hypervisor partition-based isolation.
306+
307+
Specifying the `--isolation` flag without a value is the same as setting `--isolation="default"`.
308+
290309
# HISTORY
291310
August 2014, updated by Sven Dowideit <[email protected]>
292311
September 2014, updated by Sven Dowideit <[email protected]>

man/docker-run.1.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ docker-run - Run a command in a new container
3333
[**--help**]
3434
[**-i**|**--interactive**[=*false*]]
3535
[**--ipc**[=*IPC*]]
36+
[**--isolation**[=*default*]]
3637
[**--kernel-memory**[=*KERNEL-MEMORY*]]
3738
[**-l**|**--label**[=*[]*]]
3839
[**--label-file**[=*[]*]]
@@ -253,6 +254,9 @@ redirection on the host system.
253254
'container:<name|id>': reuses another container shared memory, semaphores and message queues
254255
'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.
255256

257+
**--isolation**="*default*"
258+
Isolation specifies the type of isolation technology used by containers.
259+
256260
**-l**, **--label**=[]
257261
Set metadata on the container (e.g., --label com.example.key=value)
258262

@@ -772,6 +776,38 @@ weight by `--blkio-weight-device` flag. Use the following command:
772776

773777
# docker run -it --blkio-weight-device "/dev/sda:200" ubuntu
774778

779+
## Specify isolation technology for container (--isolation)
780+
781+
This option is useful in situations where you are running Docker containers on
782+
Microsoft Windows. The `--isolation <value>` option sets a container's isolation
783+
technology. On Linux, the only supported is the `default` option which uses
784+
Linux namespaces. These two commands are equivalent on Linux:
785+
786+
```
787+
$ docker run -d busybox top
788+
$ docker run -d --isolation default busybox top
789+
```
790+
791+
On Microsoft Windows, can take any of these values:
792+
793+
* `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.
794+
* `process`: Namespace isolation only.
795+
* `hyperv`: Hyper-V hypervisor partition-based isolation.
796+
797+
In practice, when running on Microsoft Windows without a `daemon` option set, these two commands are equivalent:
798+
799+
```
800+
$ docker run -d --isolation default busybox top
801+
$ docker run -d --isolation process busybox top
802+
```
803+
804+
If you have set the `--exec-opt isolation=hyperv` option on the Docker `daemon`, any of these commands also result in `hyperv` isolation:
805+
806+
```
807+
$ docker run -d --isolation default busybox top
808+
$ docker run -d --isolation hyperv busybox top
809+
```
810+
775811
# HISTORY
776812
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
777813
based on docker.com source material and internal work.

0 commit comments

Comments
 (0)