mirror of
				https://github.com/linuxkit/linuxkit.git
				synced 2025-10-31 05:52:56 +00:00 
			
		
		
		
	system → onboot daemon → services
As suggested by @shykes these are clearer - onboot for things that are run at boot time to completion - services for persistent services Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
		| @@ -2,11 +2,11 @@ kernel: | ||||
|   image: "mobylinux/kernel:4.9.x" | ||||
|   cmdline: "console=ttyS0 console=tty0 page_poison=1" | ||||
| init: | ||||
|   - mobylinux/init:925c88f42d92d57cd36b656db1f8757b152163a7 | ||||
|   - mobylinux/init:02f05d99b4eb9cd9223bb5915f4070cf7b67c862 | ||||
|   - mobylinux/runc:b0fb122e10dbb7e4e45115177a61a3f8d68c19a9 | ||||
|   - mobylinux/containerd:68bb523deea09da293d675cbf88474eced540b8c | ||||
|   - mobylinux/ca-certificates:eabc5a6e59f05aa91529d80e9a595b85b046f935 | ||||
| system: | ||||
| onboot: | ||||
|   - name: sysctl | ||||
|     image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c" | ||||
|     net: host | ||||
| @@ -27,7 +27,7 @@ system: | ||||
|     capabilities: | ||||
|      - CAP_SYS_ADMIN | ||||
|      - CAP_MKNOD | ||||
| daemon: | ||||
| services: | ||||
|   - name: rngd | ||||
|     image: "mobylinux/rngd:3dad6dd43270fa632ac031e99d1947f20b22eec9@sha256:1c93c1db7196f6f71f8e300bc1d15f0376dd18e8891c8789d77c8ff19f3a9a92" | ||||
|     capabilities: | ||||
|   | ||||
| @@ -2,11 +2,11 @@ kernel: | ||||
|   image: "mobylinux/kernel:4.9.x" | ||||
|   cmdline: "console=ttyS0 page_poison=1" | ||||
| init: | ||||
|   - mobylinux/init:925c88f42d92d57cd36b656db1f8757b152163a7 | ||||
|   - mobylinux/init:02f05d99b4eb9cd9223bb5915f4070cf7b67c862 | ||||
|   - mobylinux/runc:b0fb122e10dbb7e4e45115177a61a3f8d68c19a9 | ||||
|   - mobylinux/containerd:68bb523deea09da293d675cbf88474eced540b8c | ||||
|   - mobylinux/ca-certificates:eabc5a6e59f05aa91529d80e9a595b85b046f935 | ||||
| system: | ||||
| onboot: | ||||
|   - name: sysctl | ||||
|     image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c" | ||||
|     net: host | ||||
| @@ -30,7 +30,7 @@ system: | ||||
|     uts: host | ||||
|     capabilities: | ||||
|      - CAP_SYS_ADMIN | ||||
| daemon: | ||||
| services: | ||||
|   - name: rngd | ||||
|     image: "mobylinux/rngd:3dad6dd43270fa632ac031e99d1947f20b22eec9@sha256:1c93c1db7196f6f71f8e300bc1d15f0376dd18e8891c8789d77c8ff19f3a9a92" | ||||
|     capabilities: | ||||
|   | ||||
| @@ -2,11 +2,11 @@ kernel: | ||||
|   image: "mobylinux/kernel:4.9.x" | ||||
|   cmdline: "console=ttyS0 page_poison=1" | ||||
| init: | ||||
|   - mobylinux/init:925c88f42d92d57cd36b656db1f8757b152163a7 | ||||
|   - mobylinux/init:02f05d99b4eb9cd9223bb5915f4070cf7b67c862 | ||||
|   - mobylinux/runc:b0fb122e10dbb7e4e45115177a61a3f8d68c19a9 | ||||
|   - mobylinux/containerd:68bb523deea09da293d675cbf88474eced540b8c | ||||
|   - mobylinux/ca-certificates:eabc5a6e59f05aa91529d80e9a595b85b046f935 | ||||
| system: | ||||
| onboot: | ||||
|   - name: sysctl | ||||
|     image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c" | ||||
|     net: host | ||||
| @@ -18,7 +18,7 @@ system: | ||||
|     image: "mobylinux/binfmt:bdb754f25a5d851b4f5f8d185a43dfcbb3c22d01" | ||||
|     binds: | ||||
|      - /proc/sys/fs/binfmt_misc:/binfmt_misc | ||||
| daemon: | ||||
| services: | ||||
|   - name: rngd | ||||
|     image: "mobylinux/rngd:3dad6dd43270fa632ac031e99d1947f20b22eec9@sha256:1c93c1db7196f6f71f8e300bc1d15f0376dd18e8891c8789d77c8ff19f3a9a92" | ||||
|     capabilities: | ||||
|   | ||||
| @@ -2,11 +2,11 @@ kernel: | ||||
|   image: "mobylinux/kernel:4.9.x" | ||||
|   cmdline: "console=tty0 page_poison=1" | ||||
| init: | ||||
|   - mobylinux/init:925c88f42d92d57cd36b656db1f8757b152163a7 | ||||
|   - mobylinux/init:02f05d99b4eb9cd9223bb5915f4070cf7b67c862 | ||||
|   - mobylinux/runc:b0fb122e10dbb7e4e45115177a61a3f8d68c19a9 | ||||
|   - mobylinux/containerd:68bb523deea09da293d675cbf88474eced540b8c | ||||
|   - mobylinux/ca-certificates:eabc5a6e59f05aa91529d80e9a595b85b046f935 | ||||
| system: | ||||
| onboot: | ||||
|   - name: sysctl | ||||
|     image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c" | ||||
|     net: host | ||||
| @@ -20,7 +20,7 @@ system: | ||||
|     binds: | ||||
|      - /proc/sys/fs/binfmt_misc:/binfmt_misc | ||||
|     readonly: true | ||||
| daemon: | ||||
| services: | ||||
|   - name: rngd | ||||
|     image: "mobylinux/rngd:3dad6dd43270fa632ac031e99d1947f20b22eec9@sha256:1c93c1db7196f6f71f8e300bc1d15f0376dd18e8891c8789d77c8ff19f3a9a92" | ||||
|     capabilities: | ||||
|   | ||||
							
								
								
									
										6
									
								
								moby.yml
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								moby.yml
									
									
									
									
									
								
							| @@ -2,11 +2,11 @@ kernel: | ||||
|   image: "mobylinux/kernel:4.9.x" | ||||
|   cmdline: "console=ttyS0 console=tty0 page_poison=1" | ||||
| init: | ||||
|   - mobylinux/init:925c88f42d92d57cd36b656db1f8757b152163a7 | ||||
|   - mobylinux/init:02f05d99b4eb9cd9223bb5915f4070cf7b67c862 | ||||
|   - mobylinux/runc:b0fb122e10dbb7e4e45115177a61a3f8d68c19a9 | ||||
|   - mobylinux/containerd:68bb523deea09da293d675cbf88474eced540b8c | ||||
|   - mobylinux/ca-certificates:eabc5a6e59f05aa91529d80e9a595b85b046f935 | ||||
| system: | ||||
| onboot: | ||||
|   - name: sysctl | ||||
|     image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c" | ||||
|     net: host | ||||
| @@ -20,7 +20,7 @@ system: | ||||
|     binds: | ||||
|      - /proc/sys/fs/binfmt_misc:/binfmt_misc | ||||
|     readonly: true | ||||
| daemon: | ||||
| services: | ||||
|   - name: rngd | ||||
|     image: "mobylinux/rngd:3dad6dd43270fa632ac031e99d1947f20b22eec9@sha256:1c93c1db7196f6f71f8e300bc1d15f0376dd18e8891c8789d77c8ff19f3a9a92" | ||||
|     capabilities: | ||||
|   | ||||
| @@ -1,15 +1,10 @@ | ||||
| #!/bin/sh | ||||
|  | ||||
| # TODO more robust | ||||
| # while [ ! -S /run/containerd/containerd.sock ]; do sleep 1; done | ||||
| # while ! ctr list 2> /dev/null; do sleep 1; done | ||||
| # start onboot containers, run to completion | ||||
|  | ||||
| # start system containers | ||||
| # temporarily using runc not containerd | ||||
|  | ||||
| if [ -d /containers/system ] | ||||
| if [ -d /containers/onboot ] | ||||
| then | ||||
| 	for f in $(find /containers/system -mindepth 1 -maxdepth 1 | sort) | ||||
| 	for f in $(find /containers/onboot -mindepth 1 -maxdepth 1 | sort) | ||||
| 	do | ||||
| 		base="$(basename $f)" | ||||
| 		/usr/bin/runc run --bundle "$f" "$(basename $f)" | ||||
| @@ -17,9 +12,12 @@ then | ||||
| 	done | ||||
| fi | ||||
|  | ||||
| if [ -d /containers/daemon ] | ||||
| # start service containers | ||||
| # temporarily using runc not containerd | ||||
|  | ||||
| if [ -d /containers/services ] | ||||
| then | ||||
| 	for f in $(find /containers/daemon -mindepth 1 -maxdepth 1 | sort) | ||||
| 	for f in $(find /containers/services -mindepth 1 -maxdepth 1 | sort) | ||||
| 	do | ||||
| 		base="$(basename $f)" | ||||
| 		log="/var/log/$base.log" | ||||
|   | ||||
| @@ -3,7 +3,7 @@ kernel: | ||||
|   cmdline: "console=ttyS0 console=tty0 page_poison=1" | ||||
| init: | ||||
|   - "mobylinux/init:a27e32a8d6c8865d691fbfb4d0bbb93846cf7802" | ||||
| system: | ||||
| onboot: | ||||
|   - name: sysctl | ||||
|     image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c" | ||||
|     net: host | ||||
| @@ -12,7 +12,7 @@ system: | ||||
|     capabilities: | ||||
|      - CAP_SYS_ADMIN | ||||
|     readonly: true | ||||
| daemon: | ||||
| services: | ||||
|   - name: rngd | ||||
|     image: "mobylinux/rngd:3dad6dd43270fa632ac031e99d1947f20b22eec9@sha256:1c93c1db7196f6f71f8e300bc1d15f0376dd18e8891c8789d77c8ff19f3a9a92" | ||||
|     capabilities: | ||||
|   | ||||
| @@ -3,7 +3,7 @@ kernel: | ||||
|   cmdline: "console=ttyS0 console=tty0 page_poison=1" | ||||
| init: | ||||
|   - "mobylinux/init:a27e32a8d6c8865d691fbfb4d0bbb93846cf7802" | ||||
| system: | ||||
| onboot: | ||||
|   - name: sysctl | ||||
|     image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c" | ||||
|     net: host | ||||
| @@ -12,7 +12,7 @@ system: | ||||
|     capabilities: | ||||
|      - CAP_SYS_ADMIN | ||||
|     readonly: true | ||||
| daemon: | ||||
| services: | ||||
|   - name: dhcpcd | ||||
|     image: "mobylinux/dhcpcd:3eb32da7ff8051f61e0f18edd90dd0fbfcf148ea" | ||||
|     binds: | ||||
|   | ||||
| @@ -3,7 +3,7 @@ kernel: | ||||
|   cmdline: "console=ttyS0 console=tty0 page_poison=1" | ||||
| init: | ||||
|   - "mobylinux/init:c0007f0cdf1ef821a981fcc676e3f1c2dd9ab5b1" | ||||
| system: | ||||
| onboot: | ||||
|   - name: sysctl | ||||
|     image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c" | ||||
|     net: host | ||||
| @@ -24,7 +24,7 @@ system: | ||||
|     capabilities: | ||||
|      - CAP_SYS_ADMIN | ||||
|      - CAP_MKNOD | ||||
| daemon: | ||||
| services: | ||||
|   - name: rngd | ||||
|     image: "mobylinux/rngd:3dad6dd43270fa632ac031e99d1947f20b22eec9@sha256:1c93c1db7196f6f71f8e300bc1d15f0376dd18e8891c8789d77c8ff19f3a9a92" | ||||
|     capabilities: | ||||
|   | ||||
| @@ -3,7 +3,7 @@ kernel: | ||||
|   cmdline: "console=ttyS0 page_poison=1" | ||||
| init: | ||||
|   - "mobylinux/init:9d755f7e7d108d523448e4a503f1613b7d870389@sha256:9ccb16f2d8b3a09d12f5459106763f1836c064e420a13360e2e25599337960dc" | ||||
| system: | ||||
| onboot: | ||||
|   - name: sysctl | ||||
|     image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c" | ||||
|     net: host | ||||
| @@ -17,7 +17,7 @@ system: | ||||
|     binds: | ||||
|      - /proc/sys/fs/binfmt_misc:/binfmt_misc | ||||
|     readonly: true | ||||
| daemon: | ||||
| services: | ||||
|   - name: rngd | ||||
|     image: "mobylinux/rngd:3dad6dd43270fa632ac031e99d1947f20b22eec9@sha256:1c93c1db7196f6f71f8e300bc1d15f0376dd18e8891c8789d77c8ff19f3a9a92" | ||||
|     capabilities: | ||||
|   | ||||
| @@ -3,7 +3,7 @@ kernel: | ||||
|   cmdline: "console=ttyS0 page_poison=1 security=selinux selinux=1" | ||||
| init: | ||||
|   - "mobylinux/init:b5249a412536b4e69f8e1f668680d2ae185cc505" | ||||
| system: | ||||
| onboot: | ||||
|   - name: sysctl | ||||
|     image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c" | ||||
|     net: host | ||||
| @@ -12,7 +12,7 @@ system: | ||||
|     capabilities: | ||||
|      - CAP_SYS_ADMIN | ||||
|     readonly: true | ||||
| daemon: | ||||
| services: | ||||
|   - name: rngd | ||||
|     image: "mobylinux/rngd:3dad6dd43270fa632ac031e99d1947f20b22eec9@sha256:1c93c1db7196f6f71f8e300bc1d15f0376dd18e8891c8789d77c8ff19f3a9a92" | ||||
|     capabilities: | ||||
|   | ||||
| @@ -3,7 +3,7 @@ kernel: | ||||
|   cmdline: "console=ttyS0 console=tty0 page_poison=1" | ||||
| init: | ||||
|   - "mobylinux/init:c0007f0cdf1ef821a981fcc676e3f1c2dd9ab5b1" | ||||
| system: | ||||
| onboot: | ||||
|   - name: sysctl | ||||
|     image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c" | ||||
|     net: host | ||||
| @@ -17,7 +17,7 @@ system: | ||||
|     binds: | ||||
|      - /proc/sys/fs/binfmt_misc:/binfmt_misc | ||||
|     readonly: true | ||||
| daemon: | ||||
| services: | ||||
|   - name: rngd | ||||
|     image: "mobylinux/rngd:3dad6dd43270fa632ac031e99d1947f20b22eec9@sha256:1c93c1db7196f6f71f8e300bc1d15f0376dd18e8891c8789d77c8ff19f3a9a92" | ||||
|     capabilities: | ||||
|   | ||||
| @@ -3,7 +3,7 @@ kernel: | ||||
|   cmdline: "console=ttyS0 page_poison=1" | ||||
| init: | ||||
|   - "mobylinux/init-wireguard:4309fb8b65cafa9e07b0e75d86a0bff4070e67e9" | ||||
| system: | ||||
| onboot: | ||||
|   - name: sysctl | ||||
|     image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c" | ||||
|     net: host | ||||
| @@ -12,7 +12,7 @@ system: | ||||
|     capabilities: | ||||
|      - CAP_SYS_ADMIN | ||||
|     readonly: true | ||||
| daemon: | ||||
| services: | ||||
|   - name: rngd | ||||
|     image: "mobylinux/rngd:3dad6dd43270fa632ac031e99d1947f20b22eec9@sha256:1c93c1db7196f6f71f8e300bc1d15f0376dd18e8891c8789d77c8ff19f3a9a92" | ||||
|     capabilities: | ||||
|   | ||||
| @@ -137,8 +137,8 @@ func buildInternal(name string, pull bool, conf string) { | ||||
| 		initrdAppend(iw, buffer) | ||||
| 	} | ||||
|  | ||||
| 	log.Infof("Add system containers:") | ||||
| 	for i, image := range m.System { | ||||
| 	log.Infof("Add onboot containers:") | ||||
| 	for i, image := range m.Onboot { | ||||
| 		if pull || enforceContentTrust(image.Image, &m.Trust) { | ||||
| 			log.Infof("  Pull: %s", image.Image) | ||||
| 			err := dockerPull(image.Image, enforceContentTrust(image.Image, &m.Trust)) | ||||
| @@ -152,7 +152,7 @@ func buildInternal(name string, pull bool, conf string) { | ||||
| 			log.Fatalf("Failed to create config.json for %s: %v", image.Image, err) | ||||
| 		} | ||||
| 		so := fmt.Sprintf("%03d", i) | ||||
| 		path := "containers/system/" + so + "-" + image.Name | ||||
| 		path := "containers/onboot/" + so + "-" + image.Name | ||||
| 		out, err := ImageBundle(path, image.Image, config) | ||||
| 		if err != nil { | ||||
| 			log.Fatalf("Failed to extract root filesystem for %s: %v", image.Image, err) | ||||
| @@ -161,8 +161,8 @@ func buildInternal(name string, pull bool, conf string) { | ||||
| 		initrdAppend(iw, buffer) | ||||
| 	} | ||||
|  | ||||
| 	log.Infof("Add daemon containers:") | ||||
| 	for _, image := range m.Daemon { | ||||
| 	log.Infof("Add service containers:") | ||||
| 	for _, image := range m.Services { | ||||
| 		if pull || enforceContentTrust(image.Image, &m.Trust) { | ||||
| 			log.Infof("  Pull: %s", image.Image) | ||||
| 			err := dockerPull(image.Image, enforceContentTrust(image.Image, &m.Trust)) | ||||
| @@ -175,7 +175,7 @@ func buildInternal(name string, pull bool, conf string) { | ||||
| 		if err != nil { | ||||
| 			log.Fatalf("Failed to create config.json for %s: %v", image.Image, err) | ||||
| 		} | ||||
| 		path := "containers/daemon/" + image.Name | ||||
| 		path := "containers/services/" + image.Name | ||||
| 		out, err := ImageBundle(path, image.Image, config) | ||||
| 		if err != nil { | ||||
| 			log.Fatalf("Failed to extract root filesystem for %s: %v", image.Image, err) | ||||
|   | ||||
| @@ -25,8 +25,8 @@ type Moby struct { | ||||
| 		Cmdline string | ||||
| 	} | ||||
| 	Init     []string | ||||
| 	System []MobyImage | ||||
| 	Daemon []MobyImage | ||||
| 	Onboot   []MobyImage | ||||
| 	Services []MobyImage | ||||
| 	Trust    TrustConfig | ||||
| 	Files    []struct { | ||||
| 		Path      string | ||||
|   | ||||
| @@ -2,18 +2,18 @@ kernel: | ||||
|   image: "mobylinux/kernel:4.9.x" | ||||
|   cmdline: "console=ttyS0" | ||||
| init: | ||||
|   - mobylinux/init:925c88f42d92d57cd36b656db1f8757b152163a7 | ||||
|   - mobylinux/init:02f05d99b4eb9cd9223bb5915f4070cf7b67c862 | ||||
|   - mobylinux/runc:b0fb122e10dbb7e4e45115177a61a3f8d68c19a9 | ||||
|   - mobylinux/containerd:68bb523deea09da293d675cbf88474eced540b8c | ||||
|   - mobylinux/ca-certificates:eabc5a6e59f05aa91529d80e9a595b85b046f935 | ||||
| system: | ||||
| onboot: | ||||
|   - name: ltp | ||||
|     image: "mobylinux/test-ltp-20170116:fdca2d1bb019b1d51e722e6032c82c7933d4b870" | ||||
|     net: host | ||||
|     pid: host | ||||
|     capabilities: | ||||
|      - CAP_SYS_ADMIN | ||||
| daemon: | ||||
| services: | ||||
|   - name: dhcpcd | ||||
|     image: "mobylinux/dhcpcd:3eb32da7ff8051f61e0f18edd90dd0fbfcf148ea" | ||||
|     binds: | ||||
|   | ||||
| @@ -2,11 +2,11 @@ kernel: | ||||
|   image: "mobylinux/kernel:4.9.x" | ||||
|   cmdline: "console=ttyS0" | ||||
| init: | ||||
|   - mobylinux/init:925c88f42d92d57cd36b656db1f8757b152163a7 | ||||
|   - mobylinux/init:02f05d99b4eb9cd9223bb5915f4070cf7b67c862 | ||||
|   - mobylinux/runc:b0fb122e10dbb7e4e45115177a61a3f8d68c19a9 | ||||
|   - mobylinux/containerd:68bb523deea09da293d675cbf88474eced540b8c | ||||
|   - mobylinux/ca-certificates:eabc5a6e59f05aa91529d80e9a595b85b046f935 | ||||
| system: | ||||
| onboot: | ||||
|   - name: binfmt | ||||
|     image: "mobylinux/binfmt:bdb754f25a5d851b4f5f8d185a43dfcbb3c22d01" | ||||
|     binds: | ||||
| @@ -18,7 +18,7 @@ system: | ||||
|     capabilities: | ||||
|      - CAP_SYS_BOOT | ||||
|     readonly: true | ||||
| daemon: | ||||
| services: | ||||
|   - name: dhcpcd | ||||
|     image: "mobylinux/dhcpcd:3eb32da7ff8051f61e0f18edd90dd0fbfcf148ea" | ||||
|     binds: | ||||
|   | ||||
| @@ -6,11 +6,11 @@ kernel: | ||||
|   image: "mobylinux/kernel:4.9.x" | ||||
|   cmdline: "console=ttyS0 page_poison=1" | ||||
| init: | ||||
|   - mobylinux/init:925c88f42d92d57cd36b656db1f8757b152163a7 | ||||
|   - mobylinux/init:02f05d99b4eb9cd9223bb5915f4070cf7b67c862 | ||||
|   - mobylinux/runc:b0fb122e10dbb7e4e45115177a61a3f8d68c19a9 | ||||
|   - mobylinux/containerd:68bb523deea09da293d675cbf88474eced540b8c | ||||
|   - mobylinux/ca-certificates:eabc5a6e59f05aa91529d80e9a595b85b046f935 | ||||
| system: | ||||
| onboot: | ||||
|   - name: sysctl | ||||
|     image: "mobylinux/sysctl:2cf2f9d5b4d314ba1bfc22b2fe931924af666d8c" | ||||
|     net: host | ||||
| @@ -19,7 +19,7 @@ system: | ||||
|     capabilities: | ||||
|      - CAP_SYS_ADMIN | ||||
|     readonly: true | ||||
| daemon: | ||||
| services: | ||||
|   - name: rngd | ||||
|     image: "mobylinux/rngd:3dad6dd43270fa632ac031e99d1947f20b22eec9@sha256:1c93c1db7196f6f71f8e300bc1d15f0376dd18e8891c8789d77c8ff19f3a9a92" | ||||
|     capabilities: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user