Merge pull request #29200 from coolljt0725/fix_attach
fix #29199, reset container if container start failed Upstream-commit: a42ca21f50d79beae04df3ceb47496dbed7632fd Component: engine
This commit is contained in:
@@ -119,6 +119,9 @@ func (daemon *Daemon) containerStart(container *container.Container, checkpoint
|
||||
container.SetExitCode(128)
|
||||
}
|
||||
container.ToDisk()
|
||||
|
||||
container.Reset(false)
|
||||
|
||||
daemon.Cleanup(container)
|
||||
// if containers AutoRemove flag is set, remove it after clean up
|
||||
if container.HostConfig.AutoRemove {
|
||||
@@ -187,8 +190,6 @@ func (daemon *Daemon) containerStart(container *container.Container, checkpoint
|
||||
container.SetExitCode(127)
|
||||
}
|
||||
|
||||
container.Reset(false)
|
||||
|
||||
return fmt.Errorf("%s", errDesc)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user