Pārlūkot izejas kodu

Pull parent layers first before children

Michael Crosby 11 gadi atpakaļ
vecāks
revīzija
7301fbe035
1 mainītis faili ar 2 papildinājumiem un 1 dzēšanām
  1. 2 1
      server.go

+ 2 - 1
server.go

@@ -537,7 +537,8 @@ func (srv *Server) pullImage(r *registry.Registry, out io.Writer, imgID, endpoin
 	// FIXME: Try to stream the images?
 	// FIXME: Try to stream the images?
 	// FIXME: Launch the getRemoteImage() in goroutines
 	// FIXME: Launch the getRemoteImage() in goroutines
 
 
-	for _, id := range history {
+	for i := len(history) - 1; i >= 0; i-- {
+		id := history[i]
 
 
 		// ensure no two downloads of the same layer happen at the same time
 		// ensure no two downloads of the same layer happen at the same time
 		if err := srv.poolAdd("pull", "layer:"+id); err != nil {
 		if err := srv.poolAdd("pull", "layer:"+id); err != nil {