Skip to content

Commit c1a59ac

Browse files
committed
Don't destroy/delete the container if it has been checkpointed.
Docker-DCO-1.1-Signed-off-by: Ross Boucher <[email protected]> (github: boucher)
1 parent b8cebfc commit c1a59ac

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

daemon/execdriver/native/driver.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,11 @@ func (d *driver) Run(c *execdriver.Command, pipes *execdriver.Pipes, startCallba
141141
d.activeContainers[c.ID] = cont
142142
d.Unlock()
143143
defer func() {
144-
cont.Destroy()
145-
d.cleanContainer(c.ID)
144+
status, err := cont.Status()
145+
if err != nil || status != libcontainer.Checkpointed {
146+
cont.Destroy()
147+
d.cleanContainer(c.ID)
148+
}
146149
}()
147150

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

0 commit comments

Comments
 (0)