mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-21 01:59:07 +00:00
tools/guestfs: Use build --iidfile
Modelled after tools/alpine's build. Signed-off-by: Ian Campbell <ijc@docker.com>
This commit is contained in:
parent
d823d7fab7
commit
b472f79dbf
@ -5,25 +5,25 @@ IMAGE=guestfs
|
|||||||
|
|
||||||
default: push
|
default: push
|
||||||
|
|
||||||
hash: Dockerfile
|
iid: Dockerfile
|
||||||
DOCKER_CONTENT_TRUST=1 docker pull $(BASE)
|
DOCKER_CONTENT_TRUST=1 docker pull $(BASE)
|
||||||
tar cf - $^ | docker build --no-cache -t $(IMAGE):build -
|
tar cf - $^ | docker build --no-cache --iidfile iid -
|
||||||
docker run --rm $(IMAGE):build sh -c 'apt list --installed 2>/dev/null | sha1sum' | sed 's/ .*//' > hash
|
|
||||||
|
|
||||||
push: hash
|
hash: Makefile iid
|
||||||
|
docker run --rm $(shell cat iid) sh -c 'apt list --installed 2>/dev/null | sha1sum' | sed 's/ .*//' > hash
|
||||||
|
|
||||||
|
push: hash iid
|
||||||
docker pull linuxkit/$(IMAGE):$(shell cat hash) || \
|
docker pull linuxkit/$(IMAGE):$(shell cat hash) || \
|
||||||
(docker tag $(IMAGE):build linuxkit/$(IMAGE):$(shell cat hash) && \
|
(docker tag $(shell cat iid) linuxkit/$(IMAGE):$(shell cat hash) && \
|
||||||
docker push linuxkit/$(IMAGE):$(shell cat hash))
|
docker push linuxkit/$(IMAGE):$(shell cat hash))
|
||||||
docker rmi $(IMAGE):build
|
rm -f iid
|
||||||
rm -f hash
|
|
||||||
|
|
||||||
tag: hash
|
tag: hash iid
|
||||||
docker pull linuxkit/$(IMAGE):$(shell cat hash) || \
|
docker pull linuxkit/$(IMAGE):$(shell cat hash) || \
|
||||||
docker tag $(IMAGE):build linuxkit/$(IMAGE):$(shell cat hash)
|
docker tag $(shell cat iid) linuxkit/$(IMAGE):$(shell cat hash)
|
||||||
docker rmi $(IMAGE):build
|
rm -f iid
|
||||||
rm -f hash
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f hash
|
rm -f hash iid
|
||||||
|
|
||||||
.DELETE_ON_ERROR:
|
.DELETE_ON_ERROR:
|
||||||
|
Loading…
Reference in New Issue
Block a user