2015-06-12 16:19:25 +00:00
|
|
|
FROM alpine:3.2
|
2015-01-21 19:07:45 +00:00
|
|
|
MAINTAINER The Prometheus Authors <prometheus-developers@googlegroups.com>
|
2015-01-12 14:15:26 +00:00
|
|
|
|
2015-06-21 17:53:09 +00:00
|
|
|
ENV GOPATH=/go \
|
|
|
|
REPO_PATH=github.com/prometheus/prometheus
|
2015-04-23 19:15:23 +00:00
|
|
|
COPY . /go/src/github.com/prometheus/prometheus
|
2015-01-12 14:15:26 +00:00
|
|
|
|
2015-06-12 16:19:25 +00:00
|
|
|
RUN apk add --update -t build-deps go git mercurial \
|
2015-04-23 19:15:23 +00:00
|
|
|
&& apk add -u musl && rm -rf /var/cache/apk/* \
|
2015-06-21 17:53:09 +00:00
|
|
|
&& cd /go/src/$REPO_PATH \
|
2015-06-23 21:58:09 +00:00
|
|
|
&& cp -a ./Godeps/_workspace/* "$GOPATH" \
|
2015-04-23 19:15:23 +00:00
|
|
|
&& go build -ldflags " \
|
2015-06-21 17:53:09 +00:00
|
|
|
-X $REPO_PATH/version.Version $(cat version/VERSION) \
|
|
|
|
-X $REPO_PATH/version.Revision $(git rev-parse --short HEAD) \
|
|
|
|
-X $REPO_PATH/version.Branch $(git rev-parse --abbrev-ref HEAD) \
|
|
|
|
-X $REPO_PATH/version.BuildUser root@$(hostname -f) \
|
|
|
|
-X $REPO_PATH/version.BuildDate $(date +%Y%m%d-%H:%M:%S) \
|
|
|
|
-X $REPO_PATH/version.GoVersion $(go version | awk '{print substr($3,3)}') \
|
|
|
|
" -o /bin/prometheus $REPO_PATH/cmd/prometheus \
|
2015-04-24 15:29:42 +00:00
|
|
|
&& cd tools/rule_checker && go build -o /bin/rule_checker && cd ../.. \
|
2015-04-23 19:15:23 +00:00
|
|
|
&& mkdir -p /etc/prometheus \
|
2015-05-22 15:08:27 +00:00
|
|
|
&& mv ./documentation/examples/prometheus.yml /etc/prometheus/prometheus.yml \
|
2015-04-23 19:15:23 +00:00
|
|
|
&& mv ./console_libraries/ ./consoles/ /etc/prometheus/ \
|
|
|
|
&& rm -rf /go \
|
|
|
|
&& apk del --purge build-deps
|
2015-01-12 14:15:26 +00:00
|
|
|
|
2014-02-06 16:29:37 +00:00
|
|
|
EXPOSE 9090
|
2015-04-24 14:12:31 +00:00
|
|
|
VOLUME [ "/prometheus" ]
|
2014-02-06 16:29:37 +00:00
|
|
|
WORKDIR /prometheus
|
2015-04-23 19:15:23 +00:00
|
|
|
ENTRYPOINT [ "/bin/prometheus" ]
|
2015-05-22 15:08:27 +00:00
|
|
|
CMD [ "-config.file=/etc/prometheus/prometheus.yml", \
|
2015-03-03 23:34:35 +00:00
|
|
|
"-storage.local.path=/prometheus", \
|
2015-04-23 19:15:23 +00:00
|
|
|
"-web.console.libraries=/etc/prometheus/console_libraries", \
|
|
|
|
"-web.console.templates=/etc/prometheus/consoles" ]
|