Browse code

Fix docker daemon start with old running container which user volume plugin. Fixes #15720

Signed-off-by: Lei Jitang <leijitang@huawei>

Lei Jitang authored on 2015/08/21 12:29:53
Showing 1 changed files
... ...
@@ -194,14 +194,6 @@ func (daemon *Daemon) register(container *Container, updateSuffixarray bool) err
194 194
 	// we'll waste time if we update it for every container
195 195
 	daemon.idIndex.Add(container.ID)
196 196
 
197
-	if err := daemon.verifyVolumesInfo(container); err != nil {
198
-		return err
199
-	}
200
-
201
-	if err := container.prepareMountPoints(); err != nil {
202
-		return err
203
-	}
204
-
205 197
 	if container.IsRunning() {
206 198
 		logrus.Debugf("killing old running container %s", container.ID)
207 199
 		// 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
221 221
 		}
222 222
 	}
223 223
 
224
+	if err := daemon.verifyVolumesInfo(container); err != nil {
225
+		return err
226
+	}
227
+
228
+	if err := container.prepareMountPoints(); err != nil {
229
+		return err
230
+	}
231
+
224 232
 	return nil
225 233
 }
226 234