mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
3c2886d8a4
`--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> |
||
---|---|---|
.. | ||
bundlefile | ||
container | ||
formatter | ||
idresolver | ||
image | ||
inspect | ||
network | ||
node | ||
plugin | ||
registry | ||
service | ||
stack | ||
swarm | ||
system | ||
task | ||
volume | ||
cli.go | ||
client.go | ||
commands.go | ||
credentials.go | ||
hijack.go | ||
registry.go | ||
trust.go | ||
trust_test.go | ||
utils.go |