mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-21 10:09:07 +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:
parent
be9ee95c4c
commit
7e1f2088d3
@ -97,21 +97,24 @@ func buildInternal(name string, pull bool, conf string) {
|
||||
}
|
||||
initrdAppend(iw, ktar)
|
||||
|
||||
// convert init image to tarball
|
||||
// convert init images to tarballs
|
||||
log.Infof("Add init containers:")
|
||||
for _, ii := range m.Init {
|
||||
if pull {
|
||||
log.Infof("Pull init: %s", m.Init)
|
||||
err := dockerPull(m.Init)
|
||||
log.Infof("Pull init image: %s", ii)
|
||||
err := dockerPull(ii)
|
||||
if err != nil {
|
||||
log.Fatalf("Could not pull image %s: %v", m.Init, err)
|
||||
log.Fatalf("Could not pull image %s: %v", ii, err)
|
||||
}
|
||||
}
|
||||
log.Infof("Process init: %s", m.Init)
|
||||
init, err := ImageExtract(m.Init, "")
|
||||
log.Infof("Process init image: %s", ii)
|
||||
init, err := ImageExtract(ii, "")
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to build init tarball: %v", err)
|
||||
log.Fatalf("Failed to build init tarball from %s: %v", ii, 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 {
|
||||
|
Loading…
Reference in New Issue
Block a user