diff --git a/pkg/node_exporter/Dockerfile b/pkg/node_exporter/Dockerfile new file mode 100644 index 000000000..cbe9e0590 --- /dev/null +++ b/pkg/node_exporter/Dockerfile @@ -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)($|/)"] diff --git a/pkg/node_exporter/Makefile b/pkg/node_exporter/Makefile new file mode 100644 index 000000000..81d40ba97 --- /dev/null +++ b/pkg/node_exporter/Makefile @@ -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: