mirror of
https://github.com/clearlinux/docker.git
synced 2026-10-03 23:38:24 +00:00
Revert rm -f deprecation use SIGKILL instead
`rm -f` was originally deprecated in favor of `rm --stop/--kill` since `rm -f` was sending SIGTERM and potentially very slow. Instead this will bring back `rm -f` but use SIGKILL isntead Docker-DCO-1.1-Signed-off-by: Brian Goff <cpuguy83@gmail.com> (github: cpuguy83)
This commit is contained in:
+2
-8
@@ -20,9 +20,7 @@ func (daemon *Daemon) ContainerDestroy(job *engine.Job) engine.Status {
|
||||
name := job.Args[0]
|
||||
removeVolume := job.GetenvBool("removeVolume")
|
||||
removeLink := job.GetenvBool("removeLink")
|
||||
stop := job.GetenvBool("stop")
|
||||
kill := job.GetenvBool("kill")
|
||||
|
||||
forceRemove := job.GetenvBool("forceRemove")
|
||||
container := daemon.Get(name)
|
||||
|
||||
if removeLink {
|
||||
@@ -55,11 +53,7 @@ func (daemon *Daemon) ContainerDestroy(job *engine.Job) engine.Status {
|
||||
|
||||
if container != nil {
|
||||
if container.State.IsRunning() {
|
||||
if stop {
|
||||
if err := container.Stop(5); err != nil {
|
||||
return job.Errorf("Could not stop running container, cannot remove - %v", err)
|
||||
}
|
||||
} else if kill {
|
||||
if forceRemove {
|
||||
if err := container.Kill(); err != nil {
|
||||
return job.Errorf("Could not kill running container, cannot remove - %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user