forked from prometheus/prometheus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (32 loc) · 1.55 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FROM alpine:edge
MAINTAINER The Prometheus Authors <prometheus-developers@googlegroups.com>
ENV GOPATH /go
COPY . /go/src/github.com/prometheus/prometheus
RUN apk add --update -t build-deps go git mercurial vim \
&& apk add -u musl && rm -rf /var/cache/apk/* \
&& go get github.com/tools/godep \
&& cd /go/src/github.com/prometheus/prometheus \
&& $GOPATH/bin/godep restore && go get -d \
&& ./scripts/embed-static.sh web/static web/templates | gofmt > web/blob/files.go \
&& go build -ldflags " \
-X main.buildVersion $(cat VERSION) \
-X main.buildRevision $(git rev-parse --short HEAD) \
-X main.buildBranch $(git rev-parse --abbrev-ref HEAD) \
-X main.buildUser root \
-X main.buildDate $(date +%Y%m%d-%H:%M:%S) \
-X main.goVersion $(go version | awk '{print substr($3,3)}') \
" -o /bin/prometheus \
&& cd tools/rule_checker && go build -o /bin/rule_checker && cd ../.. \
&& mkdir -p /etc/prometheus \
&& mv ./documentation/examples/prometheus.yml /etc/prometheus/prometheus.yml \
&& mv ./console_libraries/ ./consoles/ /etc/prometheus/ \
&& rm -rf /go \
&& apk del --purge build-deps
EXPOSE 9090
VOLUME [ "/prometheus" ]
WORKDIR /prometheus
ENTRYPOINT [ "/bin/prometheus" ]
CMD [ "-config.file=/etc/prometheus/prometheus.yml", \
"-storage.local.path=/prometheus", \
"-web.console.libraries=/etc/prometheus/console_libraries", \
"-web.console.templates=/etc/prometheus/consoles" ]