mirror of
				https://github.com/linuxkit/linuxkit.git
				synced 2025-10-31 04:34:04 +00:00 
			
		
		
		
	Make init accept a list of images not just a single one.
				
					
				
			fix #1527 Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
		| @@ -97,21 +97,24 @@ func buildInternal(name string, pull bool, conf string) { | ||||
| 	} | ||||
| 	initrdAppend(iw, ktar) | ||||
|  | ||||
| 	// convert init image to tarball | ||||
| 	if pull { | ||||
| 		log.Infof("Pull init: %s", m.Init) | ||||
| 		err := dockerPull(m.Init) | ||||
| 		if err != nil { | ||||
| 			log.Fatalf("Could not pull image %s: %v", m.Init, err) | ||||
| 	// convert init images to tarballs | ||||
| 	log.Infof("Add init containers:") | ||||
| 	for _, ii := range m.Init { | ||||
| 		if pull { | ||||
| 			log.Infof("Pull init image: %s", ii) | ||||
| 			err := dockerPull(ii) | ||||
| 			if err != nil { | ||||
| 				log.Fatalf("Could not pull image %s: %v", ii, err) | ||||
| 			} | ||||
| 		} | ||||
| 		log.Infof("Process init image: %s", ii) | ||||
| 		init, err := ImageExtract(ii, "") | ||||
| 		if err != nil { | ||||
| 			log.Fatalf("Failed to build init tarball from %s: %v", ii, err) | ||||
| 		} | ||||
| 		buffer := bytes.NewBuffer(init) | ||||
| 		initrdAppend(iw, buffer) | ||||
| 	} | ||||
| 	log.Infof("Process init: %s", m.Init) | ||||
| 	init, err := ImageExtract(m.Init, "") | ||||
| 	if err != nil { | ||||
| 		log.Fatalf("Failed to build init tarball: %v", err) | ||||
| 	} | ||||
| 	buffer := bytes.NewBuffer(init) | ||||
| 	initrdAppend(iw, buffer) | ||||
|  | ||||
| 	log.Infof("Add system containers:") | ||||
| 	for i, image := range m.System { | ||||
| @@ -161,7 +164,7 @@ func buildInternal(name string, pull bool, conf string) { | ||||
| 	} | ||||
|  | ||||
| 	// add files | ||||
| 	buffer, err = filesystem(m) | ||||
| 	buffer, err := filesystem(m) | ||||
| 	if err != nil { | ||||
| 		log.Fatalf("failed to add filesystem parts: %v", err) | ||||
| 	} | ||||
|   | ||||
| @@ -24,7 +24,7 @@ type Moby struct { | ||||
| 		Image   string | ||||
| 		Cmdline string | ||||
| 	} | ||||
| 	Init   string | ||||
| 	Init   []string | ||||
| 	System []MobyImage | ||||
| 	Daemon []MobyImage | ||||
| 	Files  []struct { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user