diff --git a/examples/docker.yml b/examples/docker.yml index 54f0634e7..11b53c078 100644 --- a/examples/docker.yml +++ b/examples/docker.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 @@ -27,7 +27,7 @@ system: capabilities: - CAP_SYS_ADMIN - CAP_MKNOD -daemon: +services: - name: rngd image: "mobylinux/rngd:3dad6dd43270fa632ac031e99d1947f20b22eec9@sha256:1c93c1db7196f6f71f8e300bc1d15f0376dd18e8891c8789d77c8ff19f3a9a92" capabilities: diff --git a/examples/gcp.yml b/examples/gcp.yml index 1d1911531..6ec8045ca 100644 --- a/examples/gcp.yml +++ b/examples/gcp.yml @@ -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: diff --git a/examples/sshd.yml b/examples/sshd.yml index 745b15e01..dadb7fdca 100644 --- a/examples/sshd.yml +++ b/examples/sshd.yml @@ -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: diff --git a/examples/vmware.yml b/examples/vmware.yml index c9fc9f338..839141e62 100644 --- a/examples/vmware.yml +++ b/examples/vmware.yml @@ -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: diff --git a/moby.yml b/moby.yml index c315c1c76..835111ef0 100644 --- a/moby.yml +++ b/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: diff --git a/pkg/init/etc/init.d/containers b/pkg/init/etc/init.d/containers index fc0afa4d4..9ff566c96 100755 --- a/pkg/init/etc/init.d/containers +++ b/pkg/init/etc/init.d/containers @@ -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" diff --git a/projects/demo/etcd/etcd.yml b/projects/demo/etcd/etcd.yml index 2fc4605bf..1a553bd8a 100644 --- a/projects/demo/etcd/etcd.yml +++ b/projects/demo/etcd/etcd.yml @@ -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: diff --git a/projects/demo/intro/intro.yml b/projects/demo/intro/intro.yml index f71e6492f..02160ee93 100644 --- a/projects/demo/intro/intro.yml +++ b/projects/demo/intro/intro.yml @@ -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: diff --git a/projects/kubernetes/kube-master.yml b/projects/kubernetes/kube-master.yml index b5fdad989..b52d3bb9c 100644 --- a/projects/kubernetes/kube-master.yml +++ b/projects/kubernetes/kube-master.yml @@ -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: diff --git a/projects/miragesdk/examples/mirage-dhcp.yml b/projects/miragesdk/examples/mirage-dhcp.yml index e8cd50da8..9a717a187 100644 --- a/projects/miragesdk/examples/mirage-dhcp.yml +++ b/projects/miragesdk/examples/mirage-dhcp.yml @@ -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: diff --git a/projects/selinux/selinux.yml b/projects/selinux/selinux.yml index af937d18a..800521f6e 100644 --- a/projects/selinux/selinux.yml +++ b/projects/selinux/selinux.yml @@ -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: diff --git a/projects/swarmd/swarmd.yml b/projects/swarmd/swarmd.yml index aace85a0f..e5fe427cb 100644 --- a/projects/swarmd/swarmd.yml +++ b/projects/swarmd/swarmd.yml @@ -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: diff --git a/projects/wireguard/examples/wireguard.yml b/projects/wireguard/examples/wireguard.yml index 07ca39877..2e6548068 100644 --- a/projects/wireguard/examples/wireguard.yml +++ b/projects/wireguard/examples/wireguard.yml @@ -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: diff --git a/src/cmd/moby/build.go b/src/cmd/moby/build.go index 2de9c146d..ed3d887f7 100644 --- a/src/cmd/moby/build.go +++ b/src/cmd/moby/build.go @@ -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) diff --git a/src/cmd/moby/config.go b/src/cmd/moby/config.go index 9c93767df..11a9eafe4 100644 --- a/src/cmd/moby/config.go +++ b/src/cmd/moby/config.go @@ -24,11 +24,11 @@ type Moby struct { Image string Cmdline string } - Init []string - System []MobyImage - Daemon []MobyImage - Trust TrustConfig - Files []struct { + Init []string + Onboot []MobyImage + Services []MobyImage + Trust TrustConfig + Files []struct { Path string Directory bool Contents string diff --git a/test/ltp/test-ltp.yml b/test/ltp/test-ltp.yml index 5d736057d..bd57b8bd9 100644 --- a/test/ltp/test-ltp.yml +++ b/test/ltp/test-ltp.yml @@ -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: diff --git a/test/test.yml b/test/test.yml index 91f172241..b012b3e02 100644 --- a/test/test.yml +++ b/test/test.yml @@ -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: diff --git a/test/virtsock/test-virtsock-server.yml b/test/virtsock/test-virtsock-server.yml index a63702b16..386eadaea 100644 --- a/test/virtsock/test-virtsock-server.yml +++ b/test/virtsock/test-virtsock-server.yml @@ -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: