Skip to content

Commit

Permalink
Don't destroy/delete the container if it has been checkpointed.
Browse files Browse the repository at this point in the history
Docker-DCO-1.1-Signed-off-by: Ross Boucher <[email protected]> (github: boucher)
  • Loading branch information
boucher committed Jun 23, 2015
1 parent b8cebfc commit c1a59ac
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions daemon/execdriver/native/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,11 @@ func (d *driver) Run(c *execdriver.Command, pipes *execdriver.Pipes, startCallba
d.activeContainers[c.ID] = cont
d.Unlock()
defer func() {
cont.Destroy()
d.cleanContainer(c.ID)
status, err := cont.Status()
if err != nil || status != libcontainer.Checkpointed {
cont.Destroy()
d.cleanContainer(c.ID)
}
}()

if err := cont.Start(p); err != nil {
Expand Down

0 comments on commit c1a59ac

Please sign in to comment.