Browse Source

Merge pull request #14854 from rhvgoyal/unmount-base

docker: Unmount -init layer root before taking a snapshot
Vincent Batts 10 năm trước cách đây
mục cha
commit
1e40915e9d
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      daemon/daemon_unix.go

+ 5 - 1
daemon/daemon_unix.go

@@ -81,12 +81,16 @@ func (daemon *Daemon) createRootfs(container *Container) error {
 	if err != nil {
 	if err != nil {
 		return err
 		return err
 	}
 	}
-	defer daemon.driver.Put(initID)
 
 
 	if err := setupInitLayer(initPath); err != nil {
 	if err := setupInitLayer(initPath); err != nil {
+		daemon.driver.Put(initID)
 		return err
 		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 {
 	if err := daemon.driver.Create(container.ID, initID); err != nil {
 		return err
 		return err
 	}
 	}