diff --git a/Dockerfile b/Dockerfile index 6d7ab92..ced81de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,24 @@ FROM ubuntu:14.04 MAINTAINER Vaibhav Bhembre +ENV GOROOT /goroot ENV GOPATH /go +ENV PATH $GOROOT/bin:$PATH ENV APPLOC $GOPATH/src/github.com/digitalocean/ceph_exporter +ADD . $APPLOC + 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 +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 RUN go get -d && \ - go build -o /bin/ceph_exporter && \ - rm -rf $GOPATH + go build -o /bin/ceph_exporter -ENTRYPOINT ["/bin/ceph_exporter" +EXPOSE 9190 +CMD ["/bin/ceph_exporter"]