2015-04-23 12:15:23 -07:00
|
|
|
FROM alpine:edge
|
2015-01-21 11:07:45 -08:00
|
|
|
MAINTAINER The Prometheus Authors <prometheus-developers@googlegroups.com>
|
2015-01-12 06:15:26 -08:00
|
|
|
|
2015-04-23 12:15:23 -07:00
|
|
|
ENV GOPATH /go
|
|
|
|
COPY . /go/src/github.com/prometheus/prometheus
|
2015-01-12 06:15:26 -08:00
|
|
|
|
2015-04-23 12:15:23 -07:00
|
|
|
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 \
|
2015-05-28 13:03:34 -07:00
|
|
|
&& ./scripts/embed-static.sh web/static web/templates | gofmt > web/blob/files.go \
|
2015-04-23 12:15:23 -07:00
|
|
|
&& 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 \
|
2015-04-24 08:29:42 -07:00
|
|
|
&& cd tools/rule_checker && go build -o /bin/rule_checker && cd ../.. \
|
2015-04-23 12:15:23 -07:00
|
|
|
&& mkdir -p /etc/prometheus \
|
2015-05-22 08:08:27 -07:00
|
|
|
&& mv ./documentation/examples/prometheus.yml /etc/prometheus/prometheus.yml \
|
2015-04-23 12:15:23 -07:00
|
|
|
&& mv ./console_libraries/ ./consoles/ /etc/prometheus/ \
|
|
|
|
&& rm -rf /go \
|
|
|
|
&& apk del --purge build-deps
|
2015-01-12 06:15:26 -08:00
|
|
|
|
2014-02-06 08:29:37 -08:00
|
|
|
EXPOSE 9090
|
2015-04-24 07:12:31 -07:00
|
|
|
VOLUME [ "/prometheus" ]
|
2014-02-06 08:29:37 -08:00
|
|
|
WORKDIR /prometheus
|
2015-04-23 12:15:23 -07:00
|
|
|
ENTRYPOINT [ "/bin/prometheus" ]
|
2015-05-22 08:08:27 -07:00
|
|
|
CMD [ "-config.file=/etc/prometheus/prometheus.yml", \
|
2015-03-03 15:34:35 -08:00
|
|
|
"-storage.local.path=/prometheus", \
|
2015-04-23 12:15:23 -07:00
|
|
|
"-web.console.libraries=/etc/prometheus/console_libraries", \
|
|
|
|
"-web.console.templates=/etc/prometheus/consoles" ]
|