1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/api/client
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
..
bundlefile Add some tests for bundlefile and improve the error messages for LoadFile 2016-06-16 18:18:25 -04:00
container Move --rm to daemon side 2016-08-08 22:46:53 +08:00
formatter Add volume --format flag to ls 2016-08-04 14:59:55 +02:00
idresolver Update to new swarmkit/engine-api 2016-06-30 17:22:47 -07:00
image Refactor dockerCli *Format to ConfigFile call 2016-08-04 15:00:00 +02:00
inspect
network Refactor dockerCli *Format to ConfigFile call 2016-08-04 15:00:00 +02:00
node swarm: improve cli output on node promote/demote for unchanged role 2016-08-05 15:51:32 -07:00
plugin Add --force to docker plugin remove 2016-08-04 15:55:45 -07:00
registry fix stdout and stderr in api client 2016-07-05 23:07:40 +08:00
service cli: service inspect - Null check for UpdateConfig 2016-08-05 22:42:14 +01:00
stack cli: docker service|node|stack ps instead of tasks 2016-07-27 11:06:42 -07:00
swarm Improve swarm join-token instructions 2016-08-02 16:44:02 +02:00
system Ignore 'not a swarm error' when inspecting a task. 2016-08-03 12:22:07 -04:00
task service tasks: Improve error reporting 2016-07-21 19:19:11 -07:00
volume Refactor dockerCli *Format to ConfigFile call 2016-08-04 15:00:00 +02:00
cli.go Refactor dockerCli *Format to ConfigFile call 2016-08-04 15:00:00 +02:00
client.go
commands.go Convert inspect to cobra. 2016-08-03 10:36:47 -04:00
credentials.go
hijack.go
registry.go Merge pull request #23584 from nishanttotla/private-images-swarm-services 2016-06-30 17:18:59 -07:00
trust.go api,daemon: cleanup some unused stuff 2016-06-21 14:15:19 -07:00
trust_test.go
utils.go Migrate exec command to cobra 2016-07-29 02:10:36 +00:00