mirror of
https://github.com/prometheus/alertmanager
synced 2025-01-01 11:02:07 +00:00
Merge pull request #92 from sdurrheimer/master
New Dockerfile using alpine-golang-make-onbuild base image
This commit is contained in:
commit
7859ccb570
25
Dockerfile
25
Dockerfile
@ -1,19 +1,10 @@
|
|||||||
FROM golang:latest
|
FROM sdurrheimer/alpine-golang-make-onbuild
|
||||||
MAINTAINER Prometheus Team <prometheus-developers@googlegroups.com>
|
MAINTAINER Prometheus Team <prometheus-developers@googlegroups.com>
|
||||||
|
|
||||||
RUN apt-get -qy update && apt-get -qy install vim-common
|
USER root
|
||||||
ENV PKGPATH $GOPATH/src/github.com/prometheus/alertmanager
|
RUN mkdir /alertmanager \
|
||||||
ENV GOROOT /usr/src/go
|
&& chown golang:golang /alertmanager
|
||||||
|
|
||||||
ADD . $PKGPATH
|
USER golang
|
||||||
RUN cd $PKGPATH \
|
WORKDIR /alertmanager
|
||||||
&& go get -d \
|
EXPOSE 9093
|
||||||
&& make \
|
|
||||||
&& rm -rf $PKGPATH/.deps \
|
|
||||||
&& mkdir /alertmanager \
|
|
||||||
&& chown nobody /alertmanager
|
|
||||||
|
|
||||||
USER nobody
|
|
||||||
WORKDIR /alertmanager
|
|
||||||
ENTRYPOINT [ "/go/src/github.com/prometheus/alertmanager/alertmanager" ]
|
|
||||||
EXPOSE 9093
|
|
||||||
|
@ -49,19 +49,22 @@ ifeq ($(GOOS),darwin)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
GO_VERSION ?= 1.4.2
|
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
|
GOURL ?= https://golang.org/dl
|
||||||
GOPKG ?= go$(GO_VERSION).$(GOOS)-$(GOARCH)$(RELEASE_SUFFIX).tar.gz
|
GOPKG ?= go$(GO_VERSION).$(GOOS)-$(GOARCH)$(RELEASE_SUFFIX).tar.gz
|
||||||
GOPATH := $(CURDIR)/.build/gopath
|
GOPATH := $(CURDIR)/.build/gopath
|
||||||
GOCC ?= $(GOROOT)/bin/go
|
|
||||||
GO ?= GOROOT=$(GOROOT) GOPATH=$(GOPATH) $(GOCC)
|
# Check for the correct version of go in the path. If we find it, use it.
|
||||||
GOFMT ?= $(GOROOT)/bin/gofmt
|
# 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.
|
# Never honor GOBIN, should it be set at all.
|
||||||
unexport GOBIN
|
unexport GOBIN
|
||||||
|
13
README.md
13
README.md
@ -75,3 +75,16 @@ are going to be addressed in the future:
|
|||||||
configurable amount of time for A to start firing as well before sending
|
configurable amount of time for A to start firing as well before sending
|
||||||
notifications for B. This is not yet supported.
|
notifications for B. This is not yet supported.
|
||||||
* Alertmanager has not been tested or optimized for high alert loads yet.
|
* Alertmanager has not been tested or optimized for high alert loads yet.
|
||||||
|
|
||||||
|
## Using Docker
|
||||||
|
|
||||||
|
You can deploy the Alertmanager using the [prom/alertmanager](https://registry.hub.docker.com/u/prom/alertmanager/) Docker image.
|
||||||
|
|
||||||
|
For example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker pull prom/alertmanager
|
||||||
|
|
||||||
|
docker run -d -p 9093:9093 -v $PWD/alertmanager.conf:/alertmanager.conf \
|
||||||
|
prom/alertmanager -config.file=/alertmanager.conf
|
||||||
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user