mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-19 01:06:27 +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
|
||||
|
||||
hash: Dockerfile
|
||||
iid: Dockerfile
|
||||
DOCKER_CONTENT_TRUST=1 docker pull $(BASE)
|
||||
tar cf - $^ | docker build --no-cache -t $(IMAGE):build -
|
||||
docker run --rm $(IMAGE):build sh -c 'apt list --installed 2>/dev/null | sha1sum' | sed 's/ .*//' > hash
|
||||
tar cf - $^ | docker build --no-cache --iidfile iid -
|
||||
|
||||
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 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 rmi $(IMAGE):build
|
||||
rm -f hash
|
||||
rm -f iid
|
||||
|
||||
tag: hash
|
||||
tag: hash iid
|
||||
docker pull linuxkit/$(IMAGE):$(shell cat hash) || \
|
||||
docker tag $(IMAGE):build linuxkit/$(IMAGE):$(shell cat hash)
|
||||
docker rmi $(IMAGE):build
|
||||
rm -f hash
|
||||
docker tag $(shell cat iid) linuxkit/$(IMAGE):$(shell cat hash)
|
||||
rm -f iid
|
||||
|
||||
clean:
|
||||
rm -f hash
|
||||
rm -f hash iid
|
||||
|
||||
.DELETE_ON_ERROR:
|
||||
|
Loading…
Reference in New Issue
Block a user