pkg: Add a Prometheus node_exporter package

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
Rolf Neugebauer 2017-04-15 19:22:51 -05:00
parent ab78f1a48c
commit 856a2651b0
2 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,6 @@
FROM prom/node-exporter:v0.14.0
ENTRYPOINT ["/bin/node_exporter", "-collector.procfs", "/host/proc", \
"-collector.sysfs", "/host/sys", \
"-collector.filesystem.ignored-mount-points", \
"^/(sys|proc|dev|host|etc)($|/)"]

View File

@ -0,0 +1,29 @@
.PHONY: tag push clean container
default: push
IMAGE=node_exporter
SHA_IMAGE=alpine:3.5@sha256:dfbd4a3a8ebca874ebd2474f044a0b33600d4523d03b0df76e5c5986cb02d7e8
container: Dockerfile
docker build --no-cache -t $(IMAGE):build .
hash: Dockerfile
find $^ -type f | xargs cat | docker run --rm -i $(SHA_IMAGE) sha1sum - | sed 's/ .*//' > hash
push: hash container
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 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: