![]() `--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> |
||
---|---|---|
.. | ||
client | ||
fixtures | ||
server | ||
types/backend | ||
common.go | ||
common_test.go | ||
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