moby--moby/api
Zhang Wei 3c2886d8a4 Move --rm to daemon side
`--rm` is a client side flag which caused lots of problems:
1. if client lost connection to daemon, including client crash or be
killed, there's no way to clean garbage container.
2. if docker stop a `--rm` container, this container won't be
autoremoved.
3. if docker daemon restart, container is also left over.
4. bug: `docker run --rm busybox fakecmd` will exit without cleanup.

In a word, client side `--rm` flag isn't sufficient for garbage
collection. Move the `--rm` flag to daemon will be more reasonable.

What this commit do is:
1. implement a `--rm` on daemon side, adding one flag `AutoRemove` into
HostConfig.
2. Allow `run --rm -d`, no conflicting `--rm` and `-d` any more,
auto-remove can work on detach mode.
3. `docker restart` a `--rm` container will succeed, the container won't
be autoremoved.

This commit will help a lot for daemon to do garbage collection for
temporary containers.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-08-08 22:46:53 +08:00
..
client Move --rm to daemon side 2016-08-08 22:46:53 +08:00
fixtures Add more unit tests (thus coverage) to pkg api 2015-08-04 19:51:02 +02:00
server Add --force to docker plugin remove 2016-08-04 15:55:45 -07:00
types/backend Let client print error when speicify wrong detach keys 2016-04-04 15:35:55 +08:00
README.md Update README.md 2014-07-04 18:21:13 +09:00
common.go Atomically save libtrust key file 2016-06-27 15:54:39 -07:00
common_test.go fix typos 2016-03-06 00:59:11 +08:00

README.md

This directory contains code pertaining to the Docker API:

  • Used by the docker client when communicating with the docker daemon

  • Used by third party tools wishing to interface with the docker daemon