mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-29 09:30:20 +00:00
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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user