mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
8a7289ce55
Instead of using make to install all dependencies, this uses the golang base image. This way those common base layers can be shared across other golang based images. This also stops using the Makefile to install the dependencies because we would have to install all dependencies everytime something changes. Change-Id: I5e143cc4ec3e5c9027ec4912be12297e704ffff5
28 lines
1.1 KiB
Docker
28 lines
1.1 KiB
Docker
FROM golang:1.4
|
|
MAINTAINER Prometheus Team <prometheus-developers@googlegroups.com>
|
|
RUN apt-get -qy update && apt-get -qy install vim-common gcc mercurial && \
|
|
go get github.com/tools/godep
|
|
|
|
WORKDIR /go/src/github.com/prometheus/prometheus
|
|
ADD . /go/src/github.com/prometheus/prometheus
|
|
|
|
RUN godep restore && go get -d
|
|
RUN ./utility/embed-static.sh web/static web/templates | gofmt > web/blob/files.go
|
|
|
|
RUN 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 $GOLANG_VERSION \
|
|
"
|
|
RUN cd tools/rule_checker && go build
|
|
ADD ./documentation/examples/prometheus.conf /prometheus.conf
|
|
|
|
EXPOSE 9090
|
|
VOLUME [ "/prometheus" ]
|
|
WORKDIR /prometheus
|
|
ENTRYPOINT [ "/go/src/github.com/prometheus/prometheus/prometheus" ]
|
|
CMD [ "-logtostderr", "-config.file=/prometheus.conf" ]
|