fix #29199, reset container if container start failed
Signed-off-by: Lei Jitang <leijitang@huawei.com>
(cherry picked from commit e806821b53
)
Signed-off-by: Victor Vieux <vieux@docker.com>
This commit is contained in:
parent
bec385cff0
commit
c9ec321e56
1 changed files with 3 additions and 2 deletions
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue