diff --git a/alpine/Makefile b/alpine/Makefile index 9a018aa8e..f17539d67 100644 --- a/alpine/Makefile +++ b/alpine/Makefile @@ -44,7 +44,7 @@ moby-initrd.img: Dockerfile mkinitrd.sh init $(ETCFILES) | \ docker build -q - ) && [ -n "$$BUILD" ] && echo "Built $$BUILD" && \ echo $$BUILD > mobylinux.tag && \ - docker run --read-only --net=none --log-driver=none --rm --tmpfs /tmp --tmpfs /initrd $$BUILD > $@ + docker run --rm --read-only --net=none --log-driver=none --tmpfs /tmp --tmpfs /initrd $$BUILD > $@ container-initrd.img: (find containers -type d -maxdepth 1 && \ @@ -63,12 +63,12 @@ initrd.img: moby-initrd.img container-initrd.img mobylinux-efi.iso: Dockerfile.efi initrd.img kernel/x86_64/vmlinuz64 BUILD=$$( tar cf - $^ | docker build -q -f Dockerfile.efi - ) && [ -n "$$BUILD" ] && echo "Built $$BUILD" && \ - docker run --net=none --log-driver=none --rm --cap-add sys_admin $$BUILD cat /tmp/efi/mobylinux.efi > mobylinux.efi && \ - docker run --net=none --log-driver=none --rm --cap-add sys_admin $$BUILD cat /tmp/efi/mobylinux-efi.iso > $@ + docker run --rm --net=none --log-driver=none --cap-add sys_admin $$BUILD cat /tmp/efi/mobylinux.efi > mobylinux.efi && \ + docker run --rm --net=none --log-driver=none --cap-add sys_admin $$BUILD cat /tmp/efi/mobylinux-efi.iso > $@ mobylinux-bios.iso: initrd.img kernel/x86_64/vmlinuz64 tar cf - initrd.img -C kernel/x86_64 vmlinuz64 | \ - docker run --net=none --log-driver=none --rm -i mobylinux/alpine-bios@sha256:$(ALPINE_BIOS_DIGEST) >$@ + docker run --rm --net=none --log-driver=none -i mobylinux/alpine-bios@sha256:$(ALPINE_BIOS_DIGEST) >$@ common: initrd.img $(MAKE) -C kernel diff --git a/alpine/base/alpine-base/Makefile b/alpine/base/alpine-base/Makefile index 0506c4336..e7e3a692c 100644 --- a/alpine/base/alpine-base/Makefile +++ b/alpine/base/alpine-base/Makefile @@ -14,7 +14,7 @@ push: hash docker pull mobylinux/$(IMAGE):$(shell cat hash) || \ (docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash) && \ docker push mobylinux/$(IMAGE):$(shell cat hash)) - docker run $(IMAGE):build cat /lib/apk/db/installed | grep -E '^(P|V)' | \ + docker run --rm $(IMAGE):build cat /lib/apk/db/installed | grep -E '^(P|V)' | \ awk '/^P/{printf substr($$1, 3),$$0;next} /^V/{print " " substr($$1, 3);next}' | sort > packages docker rmi -f $(IMAGE):build rm -f hash diff --git a/alpine/base/alpine-build-go/Makefile b/alpine/base/alpine-build-go/Makefile index 68a3fc878..20903cfe0 100644 --- a/alpine/base/alpine-build-go/Makefile +++ b/alpine/base/alpine-build-go/Makefile @@ -8,7 +8,7 @@ default: push hash: DOCKER_CONTENT_TRUST=1 docker pull $(BASE) tar cf - Dockerfile | docker build --no-cache -t $(IMAGE):build - - docker run $(IMAGE):build sh -c 'cat /usr/local/go/bin/go /lib/apk/db/installed | sha1sum' | sed 's/ .*//' > hash + docker run --rm $(IMAGE):build sh -c 'cat /usr/local/go/bin/go /lib/apk/db/installed | sha1sum' | sed 's/ .*//' > hash push: hash docker pull mobylinux/$(IMAGE):$(shell cat hash) || \ diff --git a/alpine/base/alpine-build-toybox/Makefile b/alpine/base/alpine-build-toybox/Makefile index f22948cfa..3e08c1f62 100644 --- a/alpine/base/alpine-build-toybox/Makefile +++ b/alpine/base/alpine-build-toybox/Makefile @@ -6,7 +6,7 @@ default: push hash: Dockerfile build.sh tar cf - $^ | docker build --no-cache -t $(IMAGE):build - - docker run --entrypoint sh $(IMAGE):build -c 'cat /Dockerfile /build.sh /lib/apk/db/installed | sha1sum' | sed 's/ .*//' > hash + docker run --rm --entrypoint sh $(IMAGE):build -c 'cat /Dockerfile /build.sh /lib/apk/db/installed | sha1sum' | sed 's/ .*//' > hash push: hash docker pull mobylinux/$(IMAGE):$(shell cat hash) || \ diff --git a/alpine/base/check-config/Makefile b/alpine/base/check-config/Makefile index d7ffd9c3c..f11748340 100644 --- a/alpine/base/check-config/Makefile +++ b/alpine/base/check-config/Makefile @@ -8,7 +8,7 @@ default: push hash: DOCKER_CONTENT_TRUST=1 docker pull $(BASE) tar cf - Dockerfile | docker build --no-cache -t $(IMAGE):build - - docker run --entrypoint=/bin/sh $(IMAGE):build -c 'cat /usr/bin/check-config.sh /lib/apk/db/installed | sha1sum' | sed 's/ .*//' > hash + docker run --rm --entrypoint=/bin/sh $(IMAGE):build -c 'cat /usr/bin/check-config.sh /lib/apk/db/installed | sha1sum' | sed 's/ .*//' > hash push: hash docker pull mobylinux/$(IMAGE):$(shell cat hash) || \ diff --git a/alpine/base/mksh/Makefile b/alpine/base/mksh/Makefile index 113a49304..7af8d98af 100644 --- a/alpine/base/mksh/Makefile +++ b/alpine/base/mksh/Makefile @@ -6,7 +6,7 @@ default: push hash: Dockerfile tar cf - $^ | docker build --no-cache -t $(IMAGE):build - - docker run --entrypoint sh $(IMAGE):build -c 'cat /Dockerfile /lib/apk/db/installed | sha1sum' | sed 's/ .*//' > hash + docker run --rm --entrypoint sh $(IMAGE):build -c 'cat /Dockerfile /lib/apk/db/installed | sha1sum' | sed 's/ .*//' > hash push: hash docker pull mobylinux/$(IMAGE):$(shell cat hash) || \ diff --git a/alpine/base/tini/Makefile b/alpine/base/tini/Makefile index 709d4d4a9..b1c10237a 100644 --- a/alpine/base/tini/Makefile +++ b/alpine/base/tini/Makefile @@ -6,7 +6,7 @@ default: push hash: Dockerfile tar cf - $^ | docker build --no-cache -t $(IMAGE):build - - docker run --entrypoint sh $(IMAGE):build -c 'cat /Dockerfile /lib/apk/db/installed | sha1sum' | sed 's/ .*//' > hash + docker run --rm --entrypoint sh $(IMAGE):build -c 'cat /Dockerfile /lib/apk/db/installed | sha1sum' | sed 's/ .*//' > hash push: hash docker pull mobylinux/$(IMAGE):$(shell cat hash) || \ diff --git a/alpine/base/toybox-media/Makefile b/alpine/base/toybox-media/Makefile index 65cd783e4..0d49a440f 100644 --- a/alpine/base/toybox-media/Makefile +++ b/alpine/base/toybox-media/Makefile @@ -7,9 +7,9 @@ IMAGE=toybox-media default: push hash: - docker run $(BASE) ls tar sh find sha1sum | \ + docker run --rm $(BASE) ls tar sh find sha1sum | \ docker build -q -t $(IMAGE):build - - docker run $(IMAGE):build tar cf - bin | docker run -i $(IMAGE):build sha1sum -b - > hash + docker run --rm $(IMAGE):build tar cf - bin | docker run -i $(IMAGE):build sha1sum -b - > hash push: hash docker pull mobylinux/$(IMAGE):$(shell cat hash) || \ diff --git a/scripts/moby.sh b/scripts/moby.sh index bf525c0c2..a28603074 100755 --- a/scripts/moby.sh +++ b/scripts/moby.sh @@ -22,4 +22,4 @@ else cp alpine/kernel/x86_64/vmlinuz64 "$mobydir"/vmlinuz64 fi -docker run --privileged --pid=host justincormack/nsenter1 /sbin/reboot +docker run --rm --privileged --pid=host justincormack/nsenter1 /sbin/reboot