automatically remove container via -rm

add AutoRemove to HostConfig
add -rm flag to docker run
add TestRunAutoRemove to test -rm
docs: add -rm to commandline/command/run
add hostConfig to container monitor
make monitor destroy the container via -rm

This adds support for automatically removing a container after it
exits. The removal of the container is handled on the server side.
This commit is contained in:
unclejack
2013-09-27 17:43:12 +03:00
parent 7447867edd
commit 22e7e107ad
4 changed files with 54 additions and 3 deletions
+2 -1
View File
@@ -174,7 +174,8 @@ func (runtime *Runtime) Register(container *Container) error {
close(container.waitLock)
} else if !nomonitor {
container.allocateNetwork()
go container.monitor()
// hostConfig isn't needed here and can be nil
go container.monitor(nil)
}
return nil
}