Merge pull request #3959 from cpuguy83/3958_add_ability_to_remove_running_container_in_single_command

Add ability to force removal of running container via docker rm -f
This commit is contained in:
unclejack
2014-03-07 00:05:57 +02:00
7 changed files with 83 additions and 2 deletions
+4
View File
@@ -890,6 +890,7 @@ func (cli *DockerCli) CmdRm(args ...string) error {
cmd := cli.Subcmd("rm", "[OPTIONS] CONTAINER [CONTAINER...]", "Remove one or more containers")
v := cmd.Bool([]string{"v", "-volumes"}, false, "Remove the volumes associated to the container")
link := cmd.Bool([]string{"l", "#link", "-link"}, false, "Remove the specified link and not the underlying container")
force := cmd.Bool([]string{"f", "-force"}, false, "Force removal of running container")
if err := cmd.Parse(args); err != nil {
return nil
@@ -905,6 +906,9 @@ func (cli *DockerCli) CmdRm(args ...string) error {
if *link {
val.Set("link", "1")
}
if *force {
val.Set("force", "1")
}
var encounteredError error
for _, name := range cmd.Args() {