This fixes markdown formatting, and formatting of tables;
- Our markdown engine doesn't support spanning rows, so
re-wrapped table contents.
- Added a CSS-styles to prevent "code" blocks in tables
from wrapping
- The "logging drivers" table didn't have a header
- Aligned table borders in source code for better readability.
- Standardize on using `-it` in stead of -i -t or -ti
- Some markup issues
- Some minor textual fixups
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
| ... | ... |
@@ -10,7 +10,10 @@ parent = "mn_reference" |
| 10 | 10 |
|
| 11 | 11 |
<!-- TODO (@thaJeztah) define more flexible table/td classes --> |
| 12 | 12 |
<style> |
| 13 |
-.content-body table .no-wrap {
|
|
| 13 |
+table .no-wrap {
|
|
| 14 |
+ white-space: nowrap; |
|
| 15 |
+} |
|
| 16 |
+table code {
|
|
| 14 | 17 |
white-space: nowrap; |
| 15 | 18 |
} |
| 16 | 19 |
</style> |
| ... | ... |
@@ -135,7 +138,8 @@ For interactive processes (like a shell), you must use `-i -t` together in |
| 135 | 135 |
order to allocate a tty for the container process. `-i -t` is often written `-it` |
| 136 | 136 |
as you'll see in later examples. Specifying `-t` is forbidden when the client |
| 137 | 137 |
standard output is redirected or piped, such as in: |
| 138 |
-`echo test | docker run -i busybox cat`. |
|
| 138 |
+ |
|
| 139 |
+ $ echo test | docker run -i busybox cat |
|
| 139 | 140 |
|
| 140 | 141 |
>**Note**: A process running as PID 1 inside a container is treated |
| 141 | 142 |
>specially by Linux: it ignores any signal with the default action. |
| ... | ... |
@@ -148,10 +152,11 @@ standard output is redirected or piped, such as in: |
| 148 | 148 |
|
| 149 | 149 |
The operator can identify a container in three ways: |
| 150 | 150 |
|
| 151 |
-- UUID long identifier |
|
| 152 |
- ("f78375b1c487e03c9438c729345e54db9d20cfa2ac1fc3494b6eb60872e74778")
|
|
| 153 |
-- UUID short identifier ("f78375b1c487")
|
|
| 154 |
-- Name ("evil_ptolemy")
|
|
| 151 |
+| Identifier type | Example value | |
|
| 152 |
+| --------------------- | ------------------------------------------------------------------ | |
|
| 153 |
+| UUID long identifier | "f78375b1c487e03c9438c729345e54db9d20cfa2ac1fc3494b6eb60872e74778" | |
|
| 154 |
+| UUID short identifier | "f78375b1c487" | |
|
| 155 |
+| Name | "evil_ptolemy" | |
|
| 155 | 156 |
|
| 156 | 157 |
The UUID identifiers come from the Docker daemon. If you do not assign a |
| 157 | 158 |
container name with the `--name` option, then the daemon generates a random |
| ... | ... |
@@ -160,7 +165,8 @@ container. If you specify a `name`, you can use it when referencing the |
| 160 | 160 |
container within a Docker network. This works for both background and foreground |
| 161 | 161 |
Docker containers. |
| 162 | 162 |
|
| 163 |
-**Note**: Containers on the default bridge network must be linked to communicate by name. |
|
| 163 |
+> **Note**: Containers on the default bridge network must be linked to |
|
| 164 |
+> communicate by name. |
|
| 164 | 165 |
|
| 165 | 166 |
### PID equivalent |
| 166 | 167 |
|
| ... | ... |
@@ -390,7 +396,7 @@ $ docker run --net=my-net -itd --name=container3 busybox |
| 390 | 390 |
### Managing /etc/hosts |
| 391 | 391 |
|
| 392 | 392 |
Your container will have lines in `/etc/hosts` which define the hostname of the |
| 393 |
-container itself as well as `localhost` and a few other common things. The |
|
| 393 |
+container itself as well as `localhost` and a few other common things. The |
|
| 394 | 394 |
`--add-host` flag can be used to add additional lines to `/etc/hosts`. |
| 395 | 395 |
|
| 396 | 396 |
$ docker run -it --add-host db-static:86.75.30.9 ubuntu cat /etc/hosts |
| ... | ... |
@@ -579,23 +585,23 @@ the `--security-opt` flag. For example, you can specify the MCS/MLS level, a |
| 579 | 579 |
requirement for MLS systems. Specifying the level in the following command |
| 580 | 580 |
allows you to share the same content between containers. |
| 581 | 581 |
|
| 582 |
- $ docker run --security-opt label:level:s0:c100,c200 -i -t fedora bash |
|
| 582 |
+ $ docker run --security-opt label:level:s0:c100,c200 -it fedora bash |
|
| 583 | 583 |
|
| 584 | 584 |
An MLS example might be: |
| 585 | 585 |
|
| 586 |
- $ docker run --security-opt label:level:TopSecret -i -t rhel7 bash |
|
| 586 |
+ $ docker run --security-opt label:level:TopSecret -it rhel7 bash |
|
| 587 | 587 |
|
| 588 | 588 |
To disable the security labeling for this container versus running with the |
| 589 | 589 |
`--permissive` flag, use the following command: |
| 590 | 590 |
|
| 591 |
- $ docker run --security-opt label:disable -i -t fedora bash |
|
| 591 |
+ $ docker run --security-opt label:disable -it fedora bash |
|
| 592 | 592 |
|
| 593 | 593 |
If you want a tighter security policy on the processes within a container, |
| 594 | 594 |
you can specify an alternate type for the container. You could run a container |
| 595 | 595 |
that is only allowed to listen on Apache ports by executing the following |
| 596 | 596 |
command: |
| 597 | 597 |
|
| 598 |
- $ docker run --security-opt label:type:svirt_apache_t -i -t centos bash |
|
| 598 |
+ $ docker run --security-opt label:type:svirt_apache_t -it centos bash |
|
| 599 | 599 |
|
| 600 | 600 |
> **Note**: You would have to write policy defining a `svirt_apache_t` type. |
| 601 | 601 |
|
| ... | ... |
@@ -611,29 +617,24 @@ parent group. |
| 611 | 611 |
The operator can also adjust the performance parameters of the |
| 612 | 612 |
container: |
| 613 | 613 |
|
| 614 |
-| Option | Description | |
|
| 615 |
-|----------------------------|---------------------------------------------------------------------------------------------| |
|
| 616 |
-| `-m`, `--memory="" ` | Memory limit (format: `<number>[<unit>]`, where unit = b, k, m or g) | |
|
| 617 |
-| `--memory-swap=""` | Total memory limit (memory + swap, format: `<number>[<unit>]`, where unit = b, k, m or g) | |
|
| 618 |
-| `--memory-reservation=""` | Memory soft limit (format: `<number>[<unit>]`, where unit = b, k, m or g) | |
|
| 619 |
-| `--kernel-memory=""` | Kernel memory limit (format: `<number>[<unit>]`, where unit = b, k, m or g) | |
|
| 620 |
-| `-c`, `--cpu-shares=0` | CPU shares (relative weight) | |
|
| 621 |
-| `--cpu-period=0` | Limit the CPU CFS (Completely Fair Scheduler) period | |
|
| 622 |
-| `--cpuset-cpus="" ` | CPUs in which to allow execution (0-3, 0,1) | |
|
| 623 |
-| `--cpuset-mems=""` | Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. | |
|
| 624 |
-| `--cpu-quota=0` | Limit the CPU CFS (Completely Fair Scheduler) quota | |
|
| 625 |
-| `--blkio-weight=0` | Block IO weight (relative weight) accepts a weight value between 10 and 1000. | |
|
| 626 |
-| `--blkio-weight-device=""` | Block IO weight (relative device weight, format: `DEVICE_NAME:WEIGHT`) | |
|
| 627 |
-| `--device-read-bps="" ` | Limit read rate from a device (format: `<device-path>:<number>[<unit>]`. | |
|
| 628 |
-| | Number is a positive integer. Unit can be one of kb, mb, or gb. | |
|
| 629 |
-| `--device-write-bps="" ` | Limit write rate to a device (format: `<device-path>:<number>[<unit>]`. | |
|
| 630 |
-| | Number is a positive integer. Unit can be one of kb, mb, or gb. | |
|
| 631 |
-| `--oom-kill-disable=false` | Whether to disable OOM Killer for the container or not. | |
|
| 632 |
-| `--memory-swappiness="" ` | Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100. | |
|
| 633 |
-| `--shm-size="" ` | Size of `/dev/shm`. The format is `<number><unit>`. `number` must be greater than `0`. | |
|
| 634 |
-| | Unit is optional and can be `b` (bytes), `k` (kilobytes), `m` (megabytes), or | |
|
| 635 |
-| | `g` (gigabytes). If you omit the unit, the system uses bytes. If you omit the size | |
|
| 636 |
-| | entirely, the system uses `64m`. | |
|
| 614 |
+| Option | Description | |
|
| 615 |
+| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | |
|
| 616 |
+| `-m`, `--memory=""` | Memory limit (format: `<number>[<unit>]`). Number is a positive integer. Unit can be one of `b`, `k`, `m`, or `g`. | |
|
| 617 |
+| `--memory-swap=""` | Total memory limit (memory + swap, format: `<number>[<unit>]`). Number is a positive integer. Unit can be one of `b`, `k`, `m`, or `g`. | |
|
| 618 |
+| `--memory-reservation=""` | Memory soft limit (format: `<number>[<unit>]`). Number is a positive integer. Unit can be one of `b`, `k`, `m`, or `g`. | |
|
| 619 |
+| `--kernel-memory=""` | Kernel memory limit (format: `<number>[<unit>]`). Number is a positive integer. Unit can be one of `b`, `k`, `m`, or `g`. | |
|
| 620 |
+| `-c`, `--cpu-shares=0` | CPU shares (relative weight) | |
|
| 621 |
+| `--cpu-period=0` | Limit the CPU CFS (Completely Fair Scheduler) period | |
|
| 622 |
+| `--cpuset-cpus=""` | CPUs in which to allow execution (0-3, 0,1) | |
|
| 623 |
+| `--cpuset-mems=""` | Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. | |
|
| 624 |
+| `--cpu-quota=0` | Limit the CPU CFS (Completely Fair Scheduler) quota | |
|
| 625 |
+| `--blkio-weight=0` | Block IO weight (relative weight) accepts a weight value between 10 and 1000. | |
|
| 626 |
+| `--blkio-weight-device=""` | Block IO weight (relative device weight, format: `DEVICE_NAME:WEIGHT`) | |
|
| 627 |
+| `--device-read-bps=""` | Limit read rate from a device (format: `<device-path>:<number>[<unit>]`). Number is a positive integer. Unit can be one of `kb`, `mb`, or `gb`. | |
|
| 628 |
+| `--device-write-bps=""` | Limit write rate to a device (format: `<device-path>:<number>[<unit>]`). Number is a positive integer. Unit can be one of `kb`, `mb`, or `gb`. | |
|
| 629 |
+| `--oom-kill-disable=false` | Whether to disable OOM Killer for the container or not. | |
|
| 630 |
+| `--memory-swappiness=""` | Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100. | |
|
| 631 |
+| `--shm-size=""` | Size of `/dev/shm`. The format is `<number><unit>`. `number` must be greater than `0`. Unit is optional and can be `b` (bytes), `k` (kilobytes), `m` (megabytes), or `g` (gigabytes). If you omit the unit, the system uses bytes. If you omit the size entirely, the system uses `64m`. | |
|
| 637 | 632 |
|
| 638 | 633 |
### User memory constraints |
| 639 | 634 |
|
| ... | ... |
@@ -687,25 +688,25 @@ We have four ways to set user memory usage: |
| 687 | 687 |
|
| 688 | 688 |
Examples: |
| 689 | 689 |
|
| 690 |
- $ docker run -ti ubuntu:14.04 /bin/bash |
|
| 690 |
+ $ docker run -it ubuntu:14.04 /bin/bash |
|
| 691 | 691 |
|
| 692 | 692 |
We set nothing about memory, this means the processes in the container can use |
| 693 | 693 |
as much memory and swap memory as they need. |
| 694 | 694 |
|
| 695 |
- $ docker run -ti -m 300M --memory-swap -1 ubuntu:14.04 /bin/bash |
|
| 695 |
+ $ docker run -it -m 300M --memory-swap -1 ubuntu:14.04 /bin/bash |
|
| 696 | 696 |
|
| 697 | 697 |
We set memory limit and disabled swap memory limit, this means the processes in |
| 698 | 698 |
the container can use 300M memory and as much swap memory as they need (if the |
| 699 | 699 |
host supports swap memory). |
| 700 | 700 |
|
| 701 |
- $ docker run -ti -m 300M ubuntu:14.04 /bin/bash |
|
| 701 |
+ $ docker run -it -m 300M ubuntu:14.04 /bin/bash |
|
| 702 | 702 |
|
| 703 | 703 |
We set memory limit only, this means the processes in the container can use |
| 704 | 704 |
300M memory and 300M swap memory, by default, the total virtual memory size |
| 705 | 705 |
(--memory-swap) will be set as double of memory, in this case, memory + swap |
| 706 | 706 |
would be 2*300M, so processes can use 300M swap memory as well. |
| 707 | 707 |
|
| 708 |
- $ docker run -ti -m 300M --memory-swap 1G ubuntu:14.04 /bin/bash |
|
| 708 |
+ $ docker run -it -m 300M --memory-swap 1G ubuntu:14.04 /bin/bash |
|
| 709 | 709 |
|
| 710 | 710 |
We set both memory and swap memory, so the processes in the container can use |
| 711 | 711 |
300M memory and 700M swap memory. |
| ... | ... |
@@ -730,7 +731,7 @@ The following example limits the memory (`-m`) to 500M and sets the memory |
| 730 | 730 |
reservation to 200M. |
| 731 | 731 |
|
| 732 | 732 |
```bash |
| 733 |
-$ docker run -ti -m 500M --memory-reservation 200M ubuntu:14.04 /bin/bash |
|
| 733 |
+$ docker run -it -m 500M --memory-reservation 200M ubuntu:14.04 /bin/bash |
|
| 734 | 734 |
``` |
| 735 | 735 |
|
| 736 | 736 |
Under this configuration, when the container consumes memory more than 200M and |
| ... | ... |
@@ -740,7 +741,7 @@ memory below 200M. |
| 740 | 740 |
The following example set memory reservation to 1G without a hard memory limit. |
| 741 | 741 |
|
| 742 | 742 |
```bash |
| 743 |
-$ docker run -ti --memory-reservation 1G ubuntu:14.04 /bin/bash |
|
| 743 |
+$ docker run -it --memory-reservation 1G ubuntu:14.04 /bin/bash |
|
| 744 | 744 |
``` |
| 745 | 745 |
|
| 746 | 746 |
The container can use as much memory as it needs. The memory reservation setting |
| ... | ... |
@@ -757,11 +758,11 @@ memory. |
| 757 | 757 |
The following example limits the memory to 100M and disables the OOM killer for |
| 758 | 758 |
this container: |
| 759 | 759 |
|
| 760 |
- $ docker run -ti -m 100M --oom-kill-disable ubuntu:14.04 /bin/bash |
|
| 760 |
+ $ docker run -it -m 100M --oom-kill-disable ubuntu:14.04 /bin/bash |
|
| 761 | 761 |
|
| 762 | 762 |
The following example, illustrates a dangerous way to use the flag: |
| 763 | 763 |
|
| 764 |
- $ docker run -ti --oom-kill-disable ubuntu:14.04 /bin/bash |
|
| 764 |
+ $ docker run -it --oom-kill-disable ubuntu:14.04 /bin/bash |
|
| 765 | 765 |
|
| 766 | 766 |
The container has unlimited memory which can cause the host to run out memory |
| 767 | 767 |
and require killing system processes to free memory. |
| ... | ... |
@@ -826,12 +827,12 @@ limit and "K" the kernel limit. There are three possible ways to set limits: |
| 826 | 826 |
|
| 827 | 827 |
Examples: |
| 828 | 828 |
|
| 829 |
- $ docker run -ti -m 500M --kernel-memory 50M ubuntu:14.04 /bin/bash |
|
| 829 |
+ $ docker run -it -m 500M --kernel-memory 50M ubuntu:14.04 /bin/bash |
|
| 830 | 830 |
|
| 831 | 831 |
We set memory and kernel memory, so the processes in the container can use |
| 832 | 832 |
500M memory in total, in this 500M memory, it can be 50M kernel memory tops. |
| 833 | 833 |
|
| 834 |
- $ docker run -ti --kernel-memory 50M ubuntu:14.04 /bin/bash |
|
| 834 |
+ $ docker run -it --kernel-memory 50M ubuntu:14.04 /bin/bash |
|
| 835 | 835 |
|
| 836 | 836 |
We set kernel memory without **-m**, so the processes in the container can |
| 837 | 837 |
use as much memory as they want, but they can only use 50M kernel memory. |
| ... | ... |
@@ -846,7 +847,7 @@ between 0 and 100. A value of 0 turns off anonymous page swapping. A value of |
| 846 | 846 |
|
| 847 | 847 |
For example, you can set: |
| 848 | 848 |
|
| 849 |
- $ docker run -ti --memory-swappiness=0 ubuntu:14.04 /bin/bash |
|
| 849 |
+ $ docker run -it --memory-swappiness=0 ubuntu:14.04 /bin/bash |
|
| 850 | 850 |
|
| 851 | 851 |
Setting the `--memory-swappiness` option is helpful when you want to retain the |
| 852 | 852 |
container's working set and to avoid swapping performance penalties. |
| ... | ... |
@@ -895,7 +896,7 @@ And usually `--cpu-period` should work with `--cpu-quota`. |
| 895 | 895 |
|
| 896 | 896 |
Examples: |
| 897 | 897 |
|
| 898 |
- $ docker run -ti --cpu-period=50000 --cpu-quota=25000 ubuntu:14.04 /bin/bash |
|
| 898 |
+ $ docker run -it --cpu-period=50000 --cpu-quota=25000 ubuntu:14.04 /bin/bash |
|
| 899 | 899 |
|
| 900 | 900 |
If there is 1 CPU, this means the container can get 50% CPU worth of run-time every 50ms. |
| 901 | 901 |
|
| ... | ... |
@@ -907,11 +908,11 @@ We can set cpus in which to allow execution for containers. |
| 907 | 907 |
|
| 908 | 908 |
Examples: |
| 909 | 909 |
|
| 910 |
- $ docker run -ti --cpuset-cpus="1,3" ubuntu:14.04 /bin/bash |
|
| 910 |
+ $ docker run -it --cpuset-cpus="1,3" ubuntu:14.04 /bin/bash |
|
| 911 | 911 |
|
| 912 | 912 |
This means processes in container can be executed on cpu 1 and cpu 3. |
| 913 | 913 |
|
| 914 |
- $ docker run -ti --cpuset-cpus="0-2" ubuntu:14.04 /bin/bash |
|
| 914 |
+ $ docker run -it --cpuset-cpus="0-2" ubuntu:14.04 /bin/bash |
|
| 915 | 915 |
|
| 916 | 916 |
This means processes in container can be executed on cpu 0, cpu 1 and cpu 2. |
| 917 | 917 |
|
| ... | ... |
@@ -920,12 +921,12 @@ on NUMA systems. |
| 920 | 920 |
|
| 921 | 921 |
Examples: |
| 922 | 922 |
|
| 923 |
- $ docker run -ti --cpuset-mems="1,3" ubuntu:14.04 /bin/bash |
|
| 923 |
+ $ docker run -it --cpuset-mems="1,3" ubuntu:14.04 /bin/bash |
|
| 924 | 924 |
|
| 925 | 925 |
This example restricts the processes in the container to only use memory from |
| 926 | 926 |
memory nodes 1 and 3. |
| 927 | 927 |
|
| 928 |
- $ docker run -ti --cpuset-mems="0-2" ubuntu:14.04 /bin/bash |
|
| 928 |
+ $ docker run -it --cpuset-mems="0-2" ubuntu:14.04 /bin/bash |
|
| 929 | 929 |
|
| 930 | 930 |
This example restricts the processes in the container to only use memory from |
| 931 | 931 |
memory nodes 0, 1 and 2. |
| ... | ... |
@@ -953,8 +954,8 @@ The `--blkio-weight` flag can set the weighting to a value between 10 to 1000. |
| 953 | 953 |
For example, the commands below create two containers with different blkio |
| 954 | 954 |
weight: |
| 955 | 955 |
|
| 956 |
- $ docker run -ti --name c1 --blkio-weight 300 ubuntu:14.04 /bin/bash |
|
| 957 |
- $ docker run -ti --name c2 --blkio-weight 600 ubuntu:14.04 /bin/bash |
|
| 956 |
+ $ docker run -it --name c1 --blkio-weight 300 ubuntu:14.04 /bin/bash |
|
| 957 |
+ $ docker run -it --name c2 --blkio-weight 600 ubuntu:14.04 /bin/bash |
|
| 958 | 958 |
|
| 959 | 959 |
If you do block IO in the two containers at the same time, by, for example: |
| 960 | 960 |
|
| ... | ... |
@@ -967,9 +968,9 @@ The `--blkio-weight-device="DEVICE_NAME:WEIGHT"` flag sets a specific device wei |
| 967 | 967 |
The `DEVICE_NAME:WEIGHT` is a string containing a colon-separated device name and weight. |
| 968 | 968 |
For example, to set `/dev/sda` device weight to `200`: |
| 969 | 969 |
|
| 970 |
-$ docker run -it \ |
|
| 971 |
- --blkio-weight-device "/dev/sda:200" \ |
|
| 972 |
- ubuntu |
|
| 970 |
+ $ docker run -it \ |
|
| 971 |
+ --blkio-weight-device "/dev/sda:200" \ |
|
| 972 |
+ ubuntu |
|
| 973 | 973 |
|
| 974 | 974 |
If you specify both the `--blkio-weight` and `--blkio-weight-device`, Docker |
| 975 | 975 |
uses the `--blkio-weight` as the default weight and uses `--blkio-weight-device` |
| ... | ... |
@@ -977,22 +978,26 @@ to override this default with a new value on a specific device. |
| 977 | 977 |
The following example uses a default weight of `300` and overrides this default |
| 978 | 978 |
on `/dev/sda` setting that weight to `200`: |
| 979 | 979 |
|
| 980 |
-$ docker run -it \ |
|
| 981 |
- --blkio-weight 300 \ |
|
| 982 |
- --blkio-weight-device "/dev/sda:200" \ |
|
| 983 |
- ubuntu |
|
| 980 |
+ $ docker run -it \ |
|
| 981 |
+ --blkio-weight 300 \ |
|
| 982 |
+ --blkio-weight-device "/dev/sda:200" \ |
|
| 983 |
+ ubuntu |
|
| 984 | 984 |
|
| 985 |
-The `--device-read-bps` flag can limit read rate from a device. |
|
| 986 |
-For example, the command creates a container and limits theread rate to `1mb` per second from `/dev/sda`: |
|
| 985 |
+The `--device-read-bps` flag limits the read rate from a device. For example, |
|
| 986 |
+this command creates a container and limits the read rate to `1mb` per second |
|
| 987 |
+from `/dev/sda`: |
|
| 987 | 988 |
|
| 988 |
- $ docker run -ti --device-read-bps /dev/sda:1mb ubuntu |
|
| 989 |
+ $ docker run -it --device-read-bps /dev/sda:1mb ubuntu |
|
| 989 | 990 |
|
| 990 |
-The `--device-write-bps` flag can limit write rate to a device. |
|
| 991 |
-For example, the command creates a container and limits write rate to `1mb` per second to `/dev/sda`: |
|
| 991 |
+The `--device-write-bps` flag limits the write rate to a device. For example, |
|
| 992 |
+this command creates a container and limits the write rate to `1mb` per second |
|
| 993 |
+for `/dev/sda`: |
|
| 992 | 994 |
|
| 993 |
- $ docker run -ti --device-write-bps /dev/sda:1mb ubuntu |
|
| 995 |
+ $ docker run -it --device-write-bps /dev/sda:1mb ubuntu |
|
| 994 | 996 |
|
| 995 |
-Both flags take limits in the `<device-path>:<limit>[unit]` format. Both read and write rates must be a positive integer. You can specify the rate in `kb` (kilobytes), `mb` (megabytes), or `gb` (gigabytes). |
|
| 997 |
+Both flags take limits in the `<device-path>:<limit>[unit]` format. Both read |
|
| 998 |
+and write rates must be a positive integer. You can specify the rate in `kb` |
|
| 999 |
+(kilobytes), `mb` (megabytes), or `gb` (gigabytes). |
|
| 996 | 1000 |
|
| 997 | 1001 |
## Additional groups |
| 998 | 1002 |
--group-add: Add Linux capabilities |
| ... | ... |
@@ -1001,7 +1006,7 @@ By default, the docker container process runs with the supplementary groups look |
| 1001 | 1001 |
up for the specified user. If one wants to add more to that list of groups, then |
| 1002 | 1002 |
one can use this flag: |
| 1003 | 1003 |
|
| 1004 |
- $ docker run -ti --rm --group-add audio --group-add dbus --group-add 777 busybox id |
|
| 1004 |
+ $ docker run -it --rm --group-add audio --group-add dbus --group-add 777 busybox id |
|
| 1005 | 1005 |
uid=0(root) gid=0(root) groups=10(wheel),29(audio),81(dbus),777 |
| 1006 | 1006 |
|
| 1007 | 1007 |
## Runtime privilege and Linux capabilities |
| ... | ... |
@@ -1051,45 +1056,45 @@ In addition to `--privileged`, the operator can have fine grain control over the |
| 1051 | 1051 |
capabilities using `--cap-add` and `--cap-drop`. By default, Docker has a default |
| 1052 | 1052 |
list of capabilities that are kept. The following table lists the Linux capability options which can be added or dropped. |
| 1053 | 1053 |
|
| 1054 |
-| Capability Key | Capability Description | |
|
| 1055 |
-| -------------- | ---------------------- | |
|
| 1056 |
-| SETPCAP | Modify process capabilities. | |
|
| 1057 |
-| SYS_MODULE| Load and unload kernel modules. | |
|
| 1058 |
-| SYS_RAWIO | Perform I/O port operations (iopl(2) and ioperm(2)). | |
|
| 1059 |
-| SYS_PACCT | Use acct(2), switch process accounting on or off. | |
|
| 1060 |
-| SYS_ADMIN | Perform a range of system administration operations. | |
|
| 1061 |
-| SYS_NICE | Raise process nice value (nice(2), setpriority(2)) and change the nice value for arbitrary processes. | |
|
| 1062 |
-| SYS_RESOURCE | Override resource Limits. | |
|
| 1063 |
-| SYS_TIME | Set system clock (settimeofday(2), stime(2), adjtimex(2)); set real-time (hardware) clock. | |
|
| 1064 |
-| SYS_TTY_CONFIG | Use vhangup(2); employ various privileged ioctl(2) operations on virtual terminals. | |
|
| 1065 |
-| MKNOD | Create special files using mknod(2). | |
|
| 1066 |
-| AUDIT_WRITE | Write records to kernel auditing log. | |
|
| 1067 |
-| AUDIT_CONTROL | Enable and disable kernel auditing; change auditing filter rules; retrieve auditing status and filtering rules. | |
|
| 1068 |
-| MAC_OVERRIDE | Allow MAC configuration or state changes. Implemented for the Smack LSM. | |
|
| 1069 |
-| MAC_ADMIN | Override Mandatory Access Control (MAC). Implemented for the Smack Linux Security Module (LSM). | |
|
| 1070 |
-| NET_ADMIN | Perform various network-related operations. | |
|
| 1071 |
-| SYSLOG | Perform privileged syslog(2) operations. | |
|
| 1072 |
-| CHOWN | Make arbitrary changes to file UIDs and GIDs (see chown(2)). | |
|
| 1073 |
-| NET_RAW | Use RAW and PACKET sockets. | |
|
| 1074 |
-| DAC_OVERRIDE | Bypass file read, write, and execute permission checks. | |
|
| 1075 |
-| FOWNER | Bypass permission checks on operations that normally require the file system UID of the process to match the UID of the file. | |
|
| 1076 |
-| DAC_READ_SEARCH | Bypass file read permission checks and directory read and execute permission checks. | |
|
| 1077 |
-| FSETID | Don't clear set-user-ID and set-group-ID permission bits when a file is modified. | |
|
| 1078 |
-| KILL | Bypass permission checks for sending signals. | |
|
| 1079 |
-| SETGID | Make arbitrary manipulations of process GIDs and supplementary GID list. | |
|
| 1080 |
-| SETUID | Make arbitrary manipulations of process UIDs. | |
|
| 1081 |
-| LINUX_IMMUTABLE | Set the FS_APPEND_FL and FS_IMMUTABLE_FL i-node flags. | |
|
| 1082 |
-| NET_BIND_SERVICE | Bind a socket to internet domain privileged ports (port numbers less than 1024). | |
|
| 1083 |
-| NET_BROADCAST | Make socket broadcasts, and listen to multicasts. | |
|
| 1084 |
-| IPC_LOCK | Lock memory (mlock(2), mlockall(2), mmap(2), shmctl(2)). | |
|
| 1085 |
-| IPC_OWNER | Bypass permission checks for operations on System V IPC objects. | |
|
| 1086 |
-| SYS_CHROOT | Use chroot(2), change root directory. | |
|
| 1087 |
-| SYS_PTRACE | Trace arbitrary processes using ptrace(2). | |
|
| 1088 |
-| SYS_BOOT | Use reboot(2) and kexec_load(2), reboot and load a new kernel for later execution. | |
|
| 1089 |
-| LEASE | Establish leases on arbitrary files (see fcntl(2)). | |
|
| 1090 |
-| SETFCAP | Set file capabilities.| |
|
| 1091 |
-| WAKE_ALARM | Trigger something that will wake up the system. | |
|
| 1092 |
-| BLOCK_SUSPEND | Employ features that can block system suspend. | |
|
| 1054 |
+| Capability Key | Capability Description | |
|
| 1055 |
+| ---------------- | ----------------------------------------------------------------------------------------------------------------------------- | |
|
| 1056 |
+| SETPCAP | Modify process capabilities. | |
|
| 1057 |
+| SYS_MODULE | Load and unload kernel modules. | |
|
| 1058 |
+| SYS_RAWIO | Perform I/O port operations (iopl(2) and ioperm(2)). | |
|
| 1059 |
+| SYS_PACCT | Use acct(2), switch process accounting on or off. | |
|
| 1060 |
+| SYS_ADMIN | Perform a range of system administration operations. | |
|
| 1061 |
+| SYS_NICE | Raise process nice value (nice(2), setpriority(2)) and change the nice value for arbitrary processes. | |
|
| 1062 |
+| SYS_RESOURCE | Override resource Limits. | |
|
| 1063 |
+| SYS_TIME | Set system clock (settimeofday(2), stime(2), adjtimex(2)); set real-time (hardware) clock. | |
|
| 1064 |
+| SYS_TTY_CONFIG | Use vhangup(2); employ various privileged ioctl(2) operations on virtual terminals. | |
|
| 1065 |
+| MKNOD | Create special files using mknod(2). | |
|
| 1066 |
+| AUDIT_WRITE | Write records to kernel auditing log. | |
|
| 1067 |
+| AUDIT_CONTROL | Enable and disable kernel auditing; change auditing filter rules; retrieve auditing status and filtering rules. | |
|
| 1068 |
+| MAC_OVERRIDE | Allow MAC configuration or state changes. Implemented for the Smack LSM. | |
|
| 1069 |
+| MAC_ADMIN | Override Mandatory Access Control (MAC). Implemented for the Smack Linux Security Module (LSM). | |
|
| 1070 |
+| NET_ADMIN | Perform various network-related operations. | |
|
| 1071 |
+| SYSLOG | Perform privileged syslog(2) operations. | |
|
| 1072 |
+| CHOWN | Make arbitrary changes to file UIDs and GIDs (see chown(2)). | |
|
| 1073 |
+| NET_RAW | Use RAW and PACKET sockets. | |
|
| 1074 |
+| DAC_OVERRIDE | Bypass file read, write, and execute permission checks. | |
|
| 1075 |
+| FOWNER | Bypass permission checks on operations that normally require the file system UID of the process to match the UID of the file. | |
|
| 1076 |
+| DAC_READ_SEARCH | Bypass file read permission checks and directory read and execute permission checks. | |
|
| 1077 |
+| FSETID | Don't clear set-user-ID and set-group-ID permission bits when a file is modified. | |
|
| 1078 |
+| KILL | Bypass permission checks for sending signals. | |
|
| 1079 |
+| SETGID | Make arbitrary manipulations of process GIDs and supplementary GID list. | |
|
| 1080 |
+| SETUID | Make arbitrary manipulations of process UIDs. | |
|
| 1081 |
+| LINUX_IMMUTABLE | Set the FS_APPEND_FL and FS_IMMUTABLE_FL i-node flags. | |
|
| 1082 |
+| NET_BIND_SERVICE | Bind a socket to internet domain privileged ports (port numbers less than 1024). | |
|
| 1083 |
+| NET_BROADCAST | Make socket broadcasts, and listen to multicasts. | |
|
| 1084 |
+| IPC_LOCK | Lock memory (mlock(2), mlockall(2), mmap(2), shmctl(2)). | |
|
| 1085 |
+| IPC_OWNER | Bypass permission checks for operations on System V IPC objects. | |
|
| 1086 |
+| SYS_CHROOT | Use chroot(2), change root directory. | |
|
| 1087 |
+| SYS_PTRACE | Trace arbitrary processes using ptrace(2). | |
|
| 1088 |
+| SYS_BOOT | Use reboot(2) and kexec_load(2), reboot and load a new kernel for later execution. | |
|
| 1089 |
+| LEASE | Establish leases on arbitrary files (see fcntl(2)). | |
|
| 1090 |
+| SETFCAP | Set file capabilities. | |
|
| 1091 |
+| WAKE_ALARM | Trigger something that will wake up the system. | |
|
| 1092 |
+| BLOCK_SUSPEND | Employ features that can block system suspend. |
|
| 1093 | 1093 |
|
| 1094 | 1094 |
Further reference information is available on the [capabilities(7) - Linux man page](http://linux.die.net/man/7/capabilities) |
| 1095 | 1095 |
|
| ... | ... |
@@ -1101,9 +1106,9 @@ operator wants to have all capabilities but `MKNOD` they could use: |
| 1101 | 1101 |
For interacting with the network stack, instead of using `--privileged` they |
| 1102 | 1102 |
should use `--cap-add=NET_ADMIN` to modify the network interfaces. |
| 1103 | 1103 |
|
| 1104 |
- $ docker run -t -i --rm ubuntu:14.04 ip link add dummy0 type dummy |
|
| 1104 |
+ $ docker run -it --rm ubuntu:14.04 ip link add dummy0 type dummy |
|
| 1105 | 1105 |
RTNETLINK answers: Operation not permitted |
| 1106 |
- $ docker run -t -i --rm --cap-add=NET_ADMIN ubuntu:14.04 ip link add dummy0 type dummy |
|
| 1106 |
+ $ docker run -it --rm --cap-add=NET_ADMIN ubuntu:14.04 ip link add dummy0 type dummy |
|
| 1107 | 1107 |
|
| 1108 | 1108 |
To mount a FUSE based filesystem, you need to combine both `--cap-add` and |
| 1109 | 1109 |
`--device`: |
| ... | ... |
@@ -1135,8 +1140,9 @@ The container can have a different logging driver than the Docker daemon. Use |
| 1135 | 1135 |
the `--log-driver=VALUE` with the `docker run` command to configure the |
| 1136 | 1136 |
container's logging driver. The following options are supported: |
| 1137 | 1137 |
|
| 1138 |
+| Driver | Description | |
|
| 1139 |
+| ----------- | ----------------------------------------------------------------------------------------------------------------------------- | |
|
| 1138 | 1140 |
| `none` | Disables any logging for the container. `docker logs` won't be available with this driver. | |
| 1139 |
-|-------------|-------------------------------------------------------------------------------------------------------------------------------| |
|
| 1140 | 1141 |
| `json-file` | Default logging driver for Docker. Writes JSON messages to file. No logging options are supported for this driver. | |
| 1141 | 1142 |
| `syslog` | Syslog logging driver for Docker. Writes log messages to syslog. | |
| 1142 | 1143 |
| `journald` | Journald logging driver for Docker. Writes log messages to `journald`. | |
| ... | ... |
@@ -1202,12 +1208,12 @@ runtime by using a string to specify the new `ENTRYPOINT`. Here is an |
| 1202 | 1202 |
example of how to run a shell in a container that has been set up to |
| 1203 | 1203 |
automatically run something else (like `/usr/bin/redis-server`): |
| 1204 | 1204 |
|
| 1205 |
- $ docker run -i -t --entrypoint /bin/bash example/redis |
|
| 1205 |
+ $ docker run -it --entrypoint /bin/bash example/redis |
|
| 1206 | 1206 |
|
| 1207 | 1207 |
or two examples of how to pass more parameters to that ENTRYPOINT: |
| 1208 | 1208 |
|
| 1209 |
- $ docker run -i -t --entrypoint /bin/bash example/redis -c ls -l |
|
| 1210 |
- $ docker run -i -t --entrypoint /usr/bin/redis-cli example/redis --help |
|
| 1209 |
+ $ docker run -it --entrypoint /bin/bash example/redis -c ls -l |
|
| 1210 |
+ $ docker run -it --entrypoint /usr/bin/redis-cli example/redis --help |
|
| 1211 | 1211 |
|
| 1212 | 1212 |
### EXPOSE (incoming ports) |
| 1213 | 1213 |
|