From ab7826fb398534b81799ea4c6034da055cc34d4a Mon Sep 17 00:00:00 2001 From: Steve Durrheimer Date: Sun, 7 Jun 2015 14:36:12 +0200 Subject: [PATCH 1/3] Update Makefile.COMMON from prometheus/utils --- Makefile.COMMON | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Makefile.COMMON b/Makefile.COMMON index 86e2e05d..81331606 100644 --- a/Makefile.COMMON +++ b/Makefile.COMMON @@ -49,19 +49,22 @@ ifeq ($(GOOS),darwin) endif GO_VERSION ?= 1.4.2 - -ifeq ($(shell type go >/dev/null && go version | sed 's/.*go\([0-9.]*\).*/\1/'), $(GO_VERSION)) - GOROOT := $(shell go env GOROOT) -else - GOROOT := $(CURDIR)/.build/go$(GO_VERSION) -endif - GOURL ?= https://golang.org/dl GOPKG ?= go$(GO_VERSION).$(GOOS)-$(GOARCH)$(RELEASE_SUFFIX).tar.gz GOPATH := $(CURDIR)/.build/gopath -GOCC ?= $(GOROOT)/bin/go -GO ?= GOROOT=$(GOROOT) GOPATH=$(GOPATH) $(GOCC) -GOFMT ?= $(GOROOT)/bin/gofmt + +# Check for the correct version of go in the path. If we find it, use it. +# Otherwise, prepare to build go locally. +ifeq ($(shell command -v "go" >/dev/null && go version | sed -e 's/^[^0-9.]*\([0-9.]*\).*/\1/'), $(GO_VERSION)) + GOCC ?= $(shell command -v "go") + GOFMT ?= $(shell command -v "gofmt") + GO ?= GOPATH=$(GOPATH) $(GOCC) +else + GOROOT ?= $(CURDIR)/.build/go$(GO_VERSION) + GOCC ?= $(GOROOT)/bin/go + GOFMT ?= $(GOROOT)/bin/gofmt + GO ?= GOROOT=$(GOROOT) GOPATH=$(GOPATH) $(GOCC) +endif # Never honor GOBIN, should it be set at all. unexport GOBIN From ab1541e6485baff3502aeba9f3196099c09192d5 Mon Sep 17 00:00:00 2001 From: Steve Durrheimer Date: Sun, 7 Jun 2015 14:36:16 +0200 Subject: [PATCH 2/3] New Dockerfile using alpine-golang-make-onbuild base image --- Dockerfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index c7dd968c..78c658ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ -FROM golang:onbuild -MAINTAINER Prometheus Team +FROM sdurrheimer/alpine-golang-make-onbuild +MAINTAINER The Prometheus Authors -ENTRYPOINT [ "go-wrapper", "run" ] -EXPOSE 9100 +EXPOSE 9100 From ef08f73c0efb03eff2111ba1d262f79de792df8b Mon Sep 17 00:00:00 2001 From: Steve Durrheimer Date: Sun, 7 Jun 2015 17:59:17 +0200 Subject: [PATCH 3/3] Add Docker instructions to the README --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 4627b678..f2dd5fe6 100644 --- a/README.md +++ b/README.md @@ -74,3 +74,15 @@ To statically set roles for a machine using labels: echo 'role{role="application_server"} 1' > /path/to/directory/role.prom.$$ mv /path/to/directory/role.prom.$$ /path/to/directory/role.prom ``` + +## Using Docker + +You can deploy this exporter using the [prom/node-exporter](https://registry.hub.docker.com/u/prom/node-exporter/) Docker image. + +For example: + +```bash +docker pull prom/node-exporter + +docker run -d -p 9100:9100 --net="host" prom/node-exporter +```