Merge pull request #14854 from rhvgoyal/unmount-base

docker: Unmount -init layer root before taking a snapshot
This commit is contained in:
Vincent Batts 2015-07-23 15:17:07 -04:00
commit 1e40915e9d
1 changed files with 5 additions and 1 deletions

View File

@ -81,12 +81,16 @@ func (daemon *Daemon) createRootfs(container *Container) error {
if err != nil {
return err
}
defer daemon.driver.Put(initID)
if err := setupInitLayer(initPath); err != nil {
daemon.driver.Put(initID)
return err
}
// We want to unmount init layer before we take snapshot of it
// for the actual container.
daemon.driver.Put(initID)
if err := daemon.driver.Create(container.ID, initID); err != nil {
return err
}