mirror of
				https://github.com/linuxkit/linuxkit.git
				synced 2025-11-04 08:07:48 +00:00 
			
		
		
		
	Merge pull request #1537 from justincormack/init-list
Make `init` accept a list of images not just a single one.
This commit is contained in:
		@@ -1,7 +1,8 @@
 | 
				
			|||||||
kernel:
 | 
					kernel:
 | 
				
			||||||
  image: "mobylinux/kernel:4.9.x"
 | 
					  image: "mobylinux/kernel:4.9.x"
 | 
				
			||||||
  cmdline: "console=ttyS0 console=tty0 page_poison=1"
 | 
					  cmdline: "console=ttyS0 console=tty0 page_poison=1"
 | 
				
			||||||
init: "mobylinux/init:7a17035030dca3938947516241f51d28922cebb2"
 | 
					init:
 | 
				
			||||||
 | 
					  - "mobylinux/init:7a17035030dca3938947516241f51d28922cebb2"
 | 
				
			||||||
system:
 | 
					system:
 | 
				
			||||||
  - name: sysctl
 | 
					  - name: sysctl
 | 
				
			||||||
    image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c"
 | 
					    image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,8 @@
 | 
				
			|||||||
kernel:
 | 
					kernel:
 | 
				
			||||||
  image: "mobylinux/kernel:4.9.x"
 | 
					  image: "mobylinux/kernel:4.9.x"
 | 
				
			||||||
  cmdline: "console=ttyS0 page_poison=1"
 | 
					  cmdline: "console=ttyS0 page_poison=1"
 | 
				
			||||||
init: "mobylinux/init:7a17035030dca3938947516241f51d28922cebb2"
 | 
					init:
 | 
				
			||||||
 | 
					  - "mobylinux/init:7a17035030dca3938947516241f51d28922cebb2"
 | 
				
			||||||
system:
 | 
					system:
 | 
				
			||||||
  - name: sysctl
 | 
					  - name: sysctl
 | 
				
			||||||
    image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c"
 | 
					    image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,8 @@
 | 
				
			|||||||
kernel:
 | 
					kernel:
 | 
				
			||||||
  image: "mobylinux/kernel:4.9.x"
 | 
					  image: "mobylinux/kernel:4.9.x"
 | 
				
			||||||
  cmdline: "console=ttyS0 page_poison=1"
 | 
					  cmdline: "console=ttyS0 page_poison=1"
 | 
				
			||||||
init: "mobylinux/init:7a17035030dca3938947516241f51d28922cebb2"
 | 
					init:
 | 
				
			||||||
 | 
					  - "mobylinux/init:7a17035030dca3938947516241f51d28922cebb2"
 | 
				
			||||||
system:
 | 
					system:
 | 
				
			||||||
  - name: sysctl
 | 
					  - name: sysctl
 | 
				
			||||||
    image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c"
 | 
					    image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,8 @@
 | 
				
			|||||||
kernel:
 | 
					kernel:
 | 
				
			||||||
  image: "mobylinux/kernel:4.9.x"
 | 
					  image: "mobylinux/kernel:4.9.x"
 | 
				
			||||||
  cmdline: "console=tty0 page_poison=1"
 | 
					  cmdline: "console=tty0 page_poison=1"
 | 
				
			||||||
init: "mobylinux/init:7a17035030dca3938947516241f51d28922cebb2"
 | 
					init:
 | 
				
			||||||
 | 
					  - "mobylinux/init:7a17035030dca3938947516241f51d28922cebb2"
 | 
				
			||||||
system:
 | 
					system:
 | 
				
			||||||
  - name: sysctl
 | 
					  - name: sysctl
 | 
				
			||||||
    image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c"
 | 
					    image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c"
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										3
									
								
								moby.yml
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								moby.yml
									
									
									
									
									
								
							@@ -1,7 +1,8 @@
 | 
				
			|||||||
kernel:
 | 
					kernel:
 | 
				
			||||||
  image: "mobylinux/kernel:4.9.x"
 | 
					  image: "mobylinux/kernel:4.9.x"
 | 
				
			||||||
  cmdline: "console=ttyS0 console=tty0 page_poison=1"
 | 
					  cmdline: "console=ttyS0 console=tty0 page_poison=1"
 | 
				
			||||||
init: "mobylinux/init:7a17035030dca3938947516241f51d28922cebb2"
 | 
					init:
 | 
				
			||||||
 | 
					  - "mobylinux/init:7a17035030dca3938947516241f51d28922cebb2"
 | 
				
			||||||
system:
 | 
					system:
 | 
				
			||||||
  - name: sysctl
 | 
					  - name: sysctl
 | 
				
			||||||
    image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c"
 | 
					    image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,8 @@
 | 
				
			|||||||
kernel:
 | 
					kernel:
 | 
				
			||||||
  image: "mobylinux/kernel:4.9.x"
 | 
					  image: "mobylinux/kernel:4.9.x"
 | 
				
			||||||
  cmdline: "console=ttyS0 console=tty0 page_poison=1"
 | 
					  cmdline: "console=ttyS0 console=tty0 page_poison=1"
 | 
				
			||||||
init: "mobylinux/init:a27e32a8d6c8865d691fbfb4d0bbb93846cf7802"
 | 
					init:
 | 
				
			||||||
 | 
					  - "mobylinux/init:a27e32a8d6c8865d691fbfb4d0bbb93846cf7802"
 | 
				
			||||||
system:
 | 
					system:
 | 
				
			||||||
  - name: sysctl
 | 
					  - name: sysctl
 | 
				
			||||||
    image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c"
 | 
					    image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,8 @@
 | 
				
			|||||||
kernel:
 | 
					kernel:
 | 
				
			||||||
  image: "mobylinux/kernel:4.9.x"
 | 
					  image: "mobylinux/kernel:4.9.x"
 | 
				
			||||||
  cmdline: "console=ttyS0 console=tty0 page_poison=1"
 | 
					  cmdline: "console=ttyS0 console=tty0 page_poison=1"
 | 
				
			||||||
init: "mobylinux/init:a27e32a8d6c8865d691fbfb4d0bbb93846cf7802"
 | 
					init:
 | 
				
			||||||
 | 
					  - "mobylinux/init:a27e32a8d6c8865d691fbfb4d0bbb93846cf7802"
 | 
				
			||||||
system:
 | 
					system:
 | 
				
			||||||
  - name: sysctl
 | 
					  - name: sysctl
 | 
				
			||||||
    image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c"
 | 
					    image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,8 @@
 | 
				
			|||||||
kernel:
 | 
					kernel:
 | 
				
			||||||
  image: "mobylinux/kernel:4.9.x"
 | 
					  image: "mobylinux/kernel:4.9.x"
 | 
				
			||||||
  cmdline: "console=ttyS0 console=tty0 page_poison=1"
 | 
					  cmdline: "console=ttyS0 console=tty0 page_poison=1"
 | 
				
			||||||
init: "mobylinux/init:c0007f0cdf1ef821a981fcc676e3f1c2dd9ab5b1"
 | 
					init:
 | 
				
			||||||
 | 
					  - "mobylinux/init:c0007f0cdf1ef821a981fcc676e3f1c2dd9ab5b1"
 | 
				
			||||||
system:
 | 
					system:
 | 
				
			||||||
  - name: sysctl
 | 
					  - name: sysctl
 | 
				
			||||||
    image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c"
 | 
					    image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,8 @@
 | 
				
			|||||||
kernel:
 | 
					kernel:
 | 
				
			||||||
  image: "mobylinux/kernel:4.9.x"
 | 
					  image: "mobylinux/kernel:4.9.x"
 | 
				
			||||||
  cmdline: "console=ttyS0 page_poison=1"
 | 
					  cmdline: "console=ttyS0 page_poison=1"
 | 
				
			||||||
init: "mobylinux/init:9d755f7e7d108d523448e4a503f1613b7d870389@sha256:9ccb16f2d8b3a09d12f5459106763f1836c064e420a13360e2e25599337960dc"
 | 
					init:
 | 
				
			||||||
 | 
					  - "mobylinux/init:9d755f7e7d108d523448e4a503f1613b7d870389@sha256:9ccb16f2d8b3a09d12f5459106763f1836c064e420a13360e2e25599337960dc"
 | 
				
			||||||
system:
 | 
					system:
 | 
				
			||||||
  - name: sysctl
 | 
					  - name: sysctl
 | 
				
			||||||
    image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c"
 | 
					    image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,8 @@
 | 
				
			|||||||
kernel:
 | 
					kernel:
 | 
				
			||||||
  image: "mobylinux/kernel-selinux:4.9.x"
 | 
					  image: "mobylinux/kernel-selinux:4.9.x"
 | 
				
			||||||
  cmdline: "console=ttyS0 page_poison=1 security=selinux selinux=1"
 | 
					  cmdline: "console=ttyS0 page_poison=1 security=selinux selinux=1"
 | 
				
			||||||
init: "mobylinux/init:b5249a412536b4e69f8e1f668680d2ae185cc505"
 | 
					init:
 | 
				
			||||||
 | 
					  - "mobylinux/init:b5249a412536b4e69f8e1f668680d2ae185cc505"
 | 
				
			||||||
system:
 | 
					system:
 | 
				
			||||||
  - name: sysctl
 | 
					  - name: sysctl
 | 
				
			||||||
    image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c"
 | 
					    image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,8 @@
 | 
				
			|||||||
kernel:
 | 
					kernel:
 | 
				
			||||||
  image: "mobylinux/kernel:4.9.x"
 | 
					  image: "mobylinux/kernel:4.9.x"
 | 
				
			||||||
  cmdline: "console=ttyS0 console=tty0 page_poison=1"
 | 
					  cmdline: "console=ttyS0 console=tty0 page_poison=1"
 | 
				
			||||||
init: "mobylinux/init:c0007f0cdf1ef821a981fcc676e3f1c2dd9ab5b1"
 | 
					init:
 | 
				
			||||||
 | 
					  - "mobylinux/init:c0007f0cdf1ef821a981fcc676e3f1c2dd9ab5b1"
 | 
				
			||||||
system:
 | 
					system:
 | 
				
			||||||
  - name: sysctl
 | 
					  - name: sysctl
 | 
				
			||||||
    image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c"
 | 
					    image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,8 @@
 | 
				
			|||||||
kernel:
 | 
					kernel:
 | 
				
			||||||
  image: "mobylinux/kernel-wireguard:4.9.x"
 | 
					  image: "mobylinux/kernel-wireguard:4.9.x"
 | 
				
			||||||
  cmdline: "console=ttyS0 page_poison=1"
 | 
					  cmdline: "console=ttyS0 page_poison=1"
 | 
				
			||||||
init: "mobylinux/init-wireguard:4309fb8b65cafa9e07b0e75d86a0bff4070e67e9"
 | 
					init:
 | 
				
			||||||
 | 
					  - "mobylinux/init-wireguard:4309fb8b65cafa9e07b0e75d86a0bff4070e67e9"
 | 
				
			||||||
system:
 | 
					system:
 | 
				
			||||||
  - name: sysctl
 | 
					  - name: sysctl
 | 
				
			||||||
    image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c"
 | 
					    image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -97,21 +97,24 @@ func buildInternal(name string, pull bool, conf string) {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
	initrdAppend(iw, ktar)
 | 
						initrdAppend(iw, ktar)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// convert init image to tarball
 | 
						// convert init images to tarballs
 | 
				
			||||||
	if pull {
 | 
						log.Infof("Add init containers:")
 | 
				
			||||||
		log.Infof("Pull init: %s", m.Init)
 | 
						for _, ii := range m.Init {
 | 
				
			||||||
		err := dockerPull(m.Init)
 | 
							if pull {
 | 
				
			||||||
		if err != nil {
 | 
								log.Infof("Pull init image: %s", ii)
 | 
				
			||||||
			log.Fatalf("Could not pull image %s: %v", m.Init, err)
 | 
								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:")
 | 
						log.Infof("Add system containers:")
 | 
				
			||||||
	for i, image := range m.System {
 | 
						for i, image := range m.System {
 | 
				
			||||||
@@ -161,7 +164,7 @@ func buildInternal(name string, pull bool, conf string) {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// add files
 | 
						// add files
 | 
				
			||||||
	buffer, err = filesystem(m)
 | 
						buffer, err := filesystem(m)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		log.Fatalf("failed to add filesystem parts: %v", err)
 | 
							log.Fatalf("failed to add filesystem parts: %v", err)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,7 +24,7 @@ type Moby struct {
 | 
				
			|||||||
		Image   string
 | 
							Image   string
 | 
				
			||||||
		Cmdline string
 | 
							Cmdline string
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	Init   string
 | 
						Init   []string
 | 
				
			||||||
	System []MobyImage
 | 
						System []MobyImage
 | 
				
			||||||
	Daemon []MobyImage
 | 
						Daemon []MobyImage
 | 
				
			||||||
	Files  []struct {
 | 
						Files  []struct {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,8 @@
 | 
				
			|||||||
kernel:
 | 
					kernel:
 | 
				
			||||||
  image: "mobylinux/kernel:4.9.x"
 | 
					  image: "mobylinux/kernel:4.9.x"
 | 
				
			||||||
  cmdline: "console=ttyS0"
 | 
					  cmdline: "console=ttyS0"
 | 
				
			||||||
init: "mobylinux/init:7a17035030dca3938947516241f51d28922cebb2"
 | 
					init:
 | 
				
			||||||
 | 
					  - "mobylinux/init:7a17035030dca3938947516241f51d28922cebb2"
 | 
				
			||||||
system:
 | 
					system:
 | 
				
			||||||
  - name: ltp
 | 
					  - name: ltp
 | 
				
			||||||
    image: "mobylinux/test-ltp-20170116:fdca2d1bb019b1d51e722e6032c82c7933d4b870"
 | 
					    image: "mobylinux/test-ltp-20170116:fdca2d1bb019b1d51e722e6032c82c7933d4b870"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,8 @@
 | 
				
			|||||||
kernel:
 | 
					kernel:
 | 
				
			||||||
  image: "mobylinux/kernel:4.9.x"
 | 
					  image: "mobylinux/kernel:4.9.x"
 | 
				
			||||||
  cmdline: "console=ttyS0"
 | 
					  cmdline: "console=ttyS0"
 | 
				
			||||||
init: "mobylinux/init:7a17035030dca3938947516241f51d28922cebb2"
 | 
					init:
 | 
				
			||||||
 | 
					  - "mobylinux/init:7a17035030dca3938947516241f51d28922cebb2"
 | 
				
			||||||
system:
 | 
					system:
 | 
				
			||||||
  - name: binfmt
 | 
					  - name: binfmt
 | 
				
			||||||
    image: "mobylinux/binfmt:bdb754f25a5d851b4f5f8d185a43dfcbb3c22d01"
 | 
					    image: "mobylinux/binfmt:bdb754f25a5d851b4f5f8d185a43dfcbb3c22d01"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,7 +5,8 @@ kernel:
 | 
				
			|||||||
  # image: "mobylinux/kernel:4.9.14-0"
 | 
					  # image: "mobylinux/kernel:4.9.14-0"
 | 
				
			||||||
  image: "mobylinux/kernel:4.9.x"
 | 
					  image: "mobylinux/kernel:4.9.x"
 | 
				
			||||||
  cmdline: "console=ttyS0 page_poison=1"
 | 
					  cmdline: "console=ttyS0 page_poison=1"
 | 
				
			||||||
init: "mobylinux/init:7a17035030dca3938947516241f51d28922cebb2"
 | 
					init:
 | 
				
			||||||
 | 
					  - "mobylinux/init:7a17035030dca3938947516241f51d28922cebb2"
 | 
				
			||||||
system:
 | 
					system:
 | 
				
			||||||
  - name: sysctl
 | 
					  - name: sysctl
 | 
				
			||||||
    image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c"
 | 
					    image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c"
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user