mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-21 01:59:07 +00:00
pkg: Use git tree hash for the prometheus node_exporter
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
parent
1748a69f2a
commit
41a1d16694
@ -1,4 +1,4 @@
|
|||||||
FROM prom/node-exporter:v0.14.0
|
FROM prom/node-exporter:v0.14.0@sha256:ea8396dd32be6195ef03438b2f459b2e69a88b8fc798c3fc51559f56d4b158fa
|
||||||
|
|
||||||
ENTRYPOINT ["/bin/node_exporter", "-collector.procfs", "/host/proc", \
|
ENTRYPOINT ["/bin/node_exporter", "-collector.procfs", "/host/proc", \
|
||||||
"-collector.sysfs", "/host/sys", \
|
"-collector.sysfs", "/host/sys", \
|
||||||
|
@ -1,29 +1,14 @@
|
|||||||
.PHONY: tag push clean container
|
.PHONY: tag push
|
||||||
default: push
|
default: push
|
||||||
|
|
||||||
IMAGE=node_exporter
|
IMAGE=node_exporter
|
||||||
SHA_IMAGE=alpine:3.5@sha256:dfbd4a3a8ebca874ebd2474f044a0b33600d4523d03b0df76e5c5986cb02d7e8
|
DEPS=Dockerfile
|
||||||
|
|
||||||
container: Dockerfile
|
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
|
||||||
docker build --no-cache -t $(IMAGE):build .
|
|
||||||
|
|
||||||
hash: Dockerfile
|
tag: $(DEPS)
|
||||||
find $^ -type f | xargs cat | docker run --rm -i $(SHA_IMAGE) sha1sum - | sed 's/ .*//' > hash
|
docker build --no-cache --network=none -t linuxkit/$(IMAGE):$(HASH) .
|
||||||
|
|
||||||
push: hash container
|
push: tag
|
||||||
docker pull linuxkit/$(IMAGE):$(shell cat hash) || \
|
docker pull linuxkit/$(IMAGE):$(HASH) || \
|
||||||
(docker tag $(IMAGE):build linuxkit/$(IMAGE):$(shell cat hash) && \
|
docker push linuxkit/$(IMAGE):$(HASH)
|
||||||
docker push linuxkit/$(IMAGE):$(shell cat hash))
|
|
||||||
docker rmi $(IMAGE):build
|
|
||||||
rm -f hash
|
|
||||||
|
|
||||||
tag: hash container
|
|
||||||
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 -rf hash
|
|
||||||
|
|
||||||
.DELETE_ON_ERROR:
|
|
||||||
|
Loading…
Reference in New Issue
Block a user