Merge pull request #93 from sdurrheimer/master

New Dockerfile using alpine-golang-make-onbuild base image
pull/94/head
Julius Volz 10 years ago
commit 2824530d16

@ -1,5 +1,4 @@
FROM golang:onbuild
MAINTAINER Prometheus Team <prometheus-developers@googlegroups.com>
FROM sdurrheimer/alpine-golang-make-onbuild
MAINTAINER The Prometheus Authors <prometheus-developers@googlegroups.com>
ENTRYPOINT [ "go-wrapper", "run" ]
EXPOSE 9100
EXPOSE 9100

@ -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

@ -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
```

Loading…
Cancel
Save