mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-12-07 14:05:57 +00:00
Using docker build is slower and needs lots of Dockerfiles, while a single image with a careful script can accept any type of image, either with `-v` to share into `/tmp` for interactive use (where you need the input and a tty, or by adding a tarball for cases where there is no login such as running tests, so you can still use a remote daemon in these cases. Signed-off-by: Justin Cormack <justin.cormack@docker.com>
30 lines
762 B
Makefile
30 lines
762 B
Makefile
.PHONY: tag push
|
|
|
|
BASE=alpine:3.5
|
|
IMAGE=qemu
|
|
|
|
default: push
|
|
|
|
hash: Dockerfile qemu.sh
|
|
DOCKER_CONTENT_TRUST=1 docker pull $(BASE)
|
|
tar cf - $^ | docker build --no-cache -t $(IMAGE):build -
|
|
docker run --rm --entrypoint /bin/sh $(IMAGE):build -c 'cat Dockerfile qemu.sh /lib/apk/db/installed | sha1sum' | sed 's/ .*//' > $@
|
|
|
|
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 rmi $(IMAGE):build
|
|
rm -f hash
|
|
|
|
tag: hash
|
|
docker pull mobylinux/$(IMAGE):$(shell cat hash) || \
|
|
docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash)
|
|
docker rmi $(IMAGE):build
|
|
rm -f hash
|
|
|
|
clean:
|
|
rm -f hash
|
|
|
|
.DELETE_ON_ERROR:
|