Update Moby tool

- rename img→raw and gcp-img→gcp
- support creating `docker` outputs, see https://github.com/moby/tool/tree/master/examples
- less memory usage via streaming outputs
- allow specification of multiple yaml files in a single command line, improves modularity
- notary fixes and local cache, so does not pull as much
- you now have to specify the full filename of the yaml file, you cannot omit the suffix

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
Justin Cormack
2017-06-07 16:53:02 +01:00
parent 3cc6c36837
commit c8a3fd0e7a
14 changed files with 20 additions and 20 deletions

View File

@@ -17,15 +17,14 @@ clean_up() {
trap clean_up EXIT
moby build -disable-content-trust -output tar,kernel+initrd,iso-bios,iso-efi,img,img-gz,qcow2,vmdk -name "${NAME}" test.yml
[ -f "${NAME}.tar" ] || exit 1
moby build -disable-content-trust -output kernel+initrd,iso-bios,iso-efi,gcp,raw,qcow2,vmdk -name "${NAME}" test.yml
[ -f "${NAME}-kernel" ] || exit 1
[ -f "${NAME}-initrd.img" ] || exit 1
[ -f "${NAME}-cmdline" ] || exit 1
[ -f "${NAME}.iso" ] || exit 1
[ -f "${NAME}-efi.iso" ] || exit 1
[ -f "${NAME}.img" ] || exit 1
[ -f "${NAME}.img.gz" ] || exit 1
[ -f "${NAME}.img.tar.gz" ] || exit 1
[ -f "${NAME}.raw" ] || exit 1
[ -f "${NAME}.qcow2" ] || exit 1
# VHD currently requires a lot of memory, disable for now
# [ -f "${NAME}.vhd" ] || exit 1

View File

@@ -17,7 +17,7 @@ clean_up() {
trap clean_up EXIT
moby build -output img -name "${NAME}" test.yml
[ -f "${NAME}.img" ] || exit 1
linuxkit run qemu "${NAME}.img" | grep -q "Welcome to LinuxKit"
moby build -output raw -name "${NAME}" test.yml
[ -f "${NAME}.raw" ] || exit 1
linuxkit run qemu "${NAME}.raw" | grep -q "Welcome to LinuxKit"
exit 0

View File

@@ -15,7 +15,7 @@ clean_up() {
trap clean_up EXIT
# Test code goes here
moby build -output kernel+initrd test-kernel-config
moby build -output kernel+initrd test-kernel-config.yml
RESULT="$(linuxkit run qemu -kernel test-kernel-config)"
echo "${RESULT}" | grep -q "suite PASSED"

View File

@@ -15,7 +15,7 @@ clean_up() {
trap clean_up EXIT
# Test code goes here
moby build -output kernel+initrd test-kernel-config
moby build -output kernel+initrd test-kernel-config.yml
RESULT="$(linuxkit run qemu test-kernel-config)"
echo "${RESULT}" | grep -q "suite PASSED"

View File

@@ -15,7 +15,7 @@ clean_up() {
trap clean_up EXIT
# Test code goes here
moby build -output kernel+initrd test-kernel-config
moby build -output kernel+initrd test-kernel-config.yml
RESULT="$(linuxkit run qemu test-kernel-config)"
echo "${RESULT}" | grep -q "suite PASSED"

View File

@@ -22,6 +22,6 @@ docker pull linuxkit/kernel:4.9.x
# Build a package
docker build -t ${IMAGE_NAME} .
# Build a LinuxKit image with kernel module (and test script)
moby build -output kernel+initrd kmod
moby build -output kernel+initrd kmod.yml
# Run it
linuxkit run qemu kmod | grep -q "Hello LinuxKit"

View File

@@ -16,7 +16,7 @@ clean_up() {
trap clean_up EXIT
# Test code goes here
moby build -output kernel+initrd test-binfmt
moby build -output kernel+initrd test-binfmt.yml
RESULT="$(linuxkit run qemu -kernel test-binfmt)"
echo "${RESULT}"
echo "${RESULT}" | grep -q "suite PASSED"

View File

@@ -16,7 +16,7 @@ clean_up() {
trap clean_up EXIT
# Test code goes here
moby build -output kernel+initrd test-ca-certificates
moby build -output kernel+initrd test-ca-certificates.yml
RESULT="$(linuxkit run qemu -kernel test-ca-certificates)"
echo "${RESULT}"
echo "${RESULT}" | grep -q "suite PASSED"

View File

@@ -16,7 +16,7 @@ clean_up() {
trap clean_up EXIT
# Test code goes here
moby build -output kernel+initrd test-dhcpcd
moby build -output kernel+initrd test-dhcpcd.yml
RESULT="$(linuxkit run qemu -kernel test-dhcpcd)"
echo "${RESULT}"
echo "${RESULT}" | grep -q "suite PASSED"

View File

@@ -16,7 +16,7 @@ clean_up() {
trap clean_up EXIT
# Test code goes here
moby build -output kernel+initrd test-sysctl
moby build -output kernel+initrd test-sysctl.yml
RESULT="$(linuxkit run qemu -kernel test-sysctl)"
echo "${RESULT}"
echo "${RESULT}" | grep -q "suite PASSED"