Files
linuxkit/test/poweroff/Makefile
Rolf Neugebauer 2af774f2e9 tests: Move ltp/poweroff over to the linuxkit org
Note, the jessie-slim image with the old sha256 does not exist anymore...

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-14 15:08:51 -05:00

30 lines
751 B
Makefile

.PHONY: tag push
BASE=alpine:3.5
IMAGE=poweroff
default: push
hash: Dockerfile poweroff.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 $^ /lib/apk/db/installed | sha1sum" | sed 's/ .*//' > hash
push: hash
docker pull linuxkit/$(IMAGE):$(shell cat hash) || \
(docker tag $(IMAGE):build linuxkit/$(IMAGE):$(shell cat hash) && \
docker push linuxkit/$(IMAGE):$(shell cat hash))
docker rmi $(IMAGE):build
rm -f hash
tag: hash
docker pull linuxkit/$(IMAGE):$(shell cat hash) || \
docker tag $(IMAGE):build linuxkit/$(IMAGE):$(shell cat hash)
docker rmi $(IMAGE):build
rm -f hash
clean:
rm -f hash
.DELETE_ON_ERROR: