Browse Source

Merge pull request #15748 from coolljt0725/fix_daemon_start_with_old_running_container

Fix docker daemon start with old running container which use thirdparty volume plugin
Brian Goff 10 years ago
parent
commit
eb7b2ed6bb
1 changed files with 8 additions and 8 deletions
  1. 8 8
      daemon/daemon.go

+ 8 - 8
daemon/daemon.go

@@ -194,14 +194,6 @@ func (daemon *Daemon) register(container *Container, updateSuffixarray bool) err
 	// we'll waste time if we update it for every container
 	daemon.idIndex.Add(container.ID)
 
-	if err := daemon.verifyVolumesInfo(container); err != nil {
-		return err
-	}
-
-	if err := container.prepareMountPoints(); err != nil {
-		return err
-	}
-
 	if container.IsRunning() {
 		logrus.Debugf("killing old running container %s", container.ID)
 		// Set exit code to 128 + SIGKILL (9) to properly represent unsuccessful exit
@@ -221,6 +213,14 @@ func (daemon *Daemon) register(container *Container, updateSuffixarray bool) err
 		}
 	}
 
+	if err := daemon.verifyVolumesInfo(container); err != nil {
+		return err
+	}
+
+	if err := container.prepareMountPoints(); err != nil {
+		return err
+	}
+
 	return nil
 }