Commit Graph

7 Commits

Author SHA1 Message Date
Zhang Wei f63d53c736 Forbid update restart policy of container with AutoRemove flag
"--restart" and "--rm" are conflict options, if a container is started
with AutoRemove flag, we should forbid the update action for its Restart
Policy.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2017-06-02 00:10:05 +00:00
Lei Jitang 3b2ecd7052 Fix update memory without memoryswap
The memory should always be smaller than memoryswap,
we should error out with message that user know how
to do rather than just an invalid argument error if
user update the memory limit bigger than already set
memory swap.

Signed-off-by: Lei Jitang <leijitang@huawei.com>
2017-06-02 00:10:04 +00:00
Qiang Huang 69eb98ada5 Fix kernel memory updating docs
Specify that kernel memory updating limitation only applies
on kernel version older than 4.6.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2017-06-02 00:10:03 +00:00
Sebastiaan van Stijn e2a6cf9fd5 docs: cleanup docker update docs
move the "kernel memory" examples to the "examples" section,
and fix some formatting and grammar.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-06-02 00:10:03 +00:00
Qiang Huang 670a0b8077 Soften limitation of update kernel memory
Kernel memory is not allowed to be updated if container is
running, it's not actually a precise kernel limitation.

Before kernel version 4.6, kernel memory will not be accounted
until kernel memory limit is set, if a container created with
kernel memory initialized, kernel memory is accounted as soon
as process created in container, so kernel memory limit update
is allowed afterward. If kernel memory is not initialized,
kernel memory consumed by processes in container will not be
accounted, so we can't update the limit because the account
will be wrong.

So update kernel memory of a running container with kernel memory
initialized is allowed, we should soften the limitation by docker.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2017-06-02 00:07:49 +00:00
Zhang Wei 623082a1eb Update RestartPolicy of container
Add `--restart` flag for `update` command, so we can change restart
policy for a container no matter it's running or stopped.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2017-06-02 00:07:29 +00:00
Qiang Huang 3f44418168 Implemet docker update command
It's used for updating properties of one or more containers, we only
support resource configs for now. It can be extended in the future.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2017-06-02 00:07:21 +00:00