Add docker integration for ceph exporter

This commit is contained in:
Vaibhav Bhembre 2016-01-06 17:20:47 -05:00
parent 3d4e949f49
commit c5bec3962d
1 changed files with 12 additions and 4 deletions

View File

@ -1,16 +1,24 @@
FROM ubuntu:14.04 FROM ubuntu:14.04
MAINTAINER Vaibhav Bhembre <vaibhav@digitalocean.com> MAINTAINER Vaibhav Bhembre <vaibhav@digitalocean.com>
ENV GOROOT /goroot
ENV GOPATH /go ENV GOPATH /go
ENV PATH $GOROOT/bin:$PATH
ENV APPLOC $GOPATH/src/github.com/digitalocean/ceph_exporter ENV APPLOC $GOPATH/src/github.com/digitalocean/ceph_exporter
ADD . $APPLOC
RUN apt-get update && \ RUN apt-get update && \
apt-get install build-essential apt-get install -y build-essential git curl && \
apt-get install -y librados-dev librbd-dev apt-get install -y librados-dev librbd-dev
RUN \
mkdir -p /goroot && \
curl https://storage.googleapis.com/golang/go1.5.2.linux-amd64.tar.gz | tar xvzf - -C /goroot --strip-components=1
WORKDIR $APPLOC WORKDIR $APPLOC
RUN go get -d && \ RUN go get -d && \
go build -o /bin/ceph_exporter && \ go build -o /bin/ceph_exporter
rm -rf $GOPATH
ENTRYPOINT ["/bin/ceph_exporter" EXPOSE 9190
CMD ["/bin/ceph_exporter"]