mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-21 10:09:07 +00:00
tests: Use git tree hash for virtsock package
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
parent
725853f11d
commit
9cb3c53b8f
@ -1,26 +1,14 @@
|
||||
.PHONY: tag push
|
||||
IMAGE=test-virtsock
|
||||
|
||||
default: push
|
||||
|
||||
IMAGE=test-virtsock
|
||||
DEPS=Dockerfile Makefile
|
||||
SHASUM=alpine:3.5
|
||||
hash: $(DEPS)
|
||||
find $^ -type f | xargs cat | DOCKER_CONTENT_TRUST=1 docker run --rm -i $(SHASUM) sha1sum | sed 's/ .*//' > $@
|
||||
|
||||
tag: hash
|
||||
docker pull linuxkit/$(IMAGE):$(shell cat hash) || \
|
||||
(docker build --no-cache -t $(IMAGE):build . && \
|
||||
docker tag $(IMAGE):build linuxkit/$(IMAGE):$(shell cat hash))
|
||||
docker rmi $(IMAGE):build || true
|
||||
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
|
||||
|
||||
tag: $(DEPS)
|
||||
docker build --no-cache -t linuxkit/$(IMAGE):$(HASH) .
|
||||
|
||||
push: tag
|
||||
docker pull linuxkit/$(IMAGE):$(shell cat hash) || \
|
||||
docker push linuxkit/$(IMAGE):$(shell cat hash)
|
||||
rm -f hash
|
||||
|
||||
clean:
|
||||
rm -rf hash
|
||||
docker rmi $(IMAGE):build || true
|
||||
|
||||
.DELETE_ON_ERROR:
|
||||
docker pull linuxkit/$(IMAGE):$(HASH) || \
|
||||
docker push linuxkit/$(IMAGE):$(HASH)
|
||||
|
Loading…
Reference in New Issue
Block a user