ceph_exporter/Dockerfile

43 lines
1.2 KiB
Docker
Raw Normal View History

FROM ubuntu:16.04 as builder
2016-01-06 19:07:02 +00:00
MAINTAINER Vaibhav Bhembre <vaibhav@digitalocean.com>
ENV GOROOT /goroot
2016-01-06 19:07:02 +00:00
ENV GOPATH /go
ENV PATH $GOROOT/bin:$PATH
2016-07-26 03:19:26 +00:00
ENV APPLOC $GOPATH/src/github.com/digitalocean/ceph_exporter
2016-01-06 19:07:02 +00:00
RUN apt-get update && \
apt-get install -y apt-transport-https build-essential git curl
RUN echo "deb https://download.ceph.com/debian-jewel xenial main" >> /etc/apt/sources.list
RUN apt-get update && \
apt-get install -y --force-yes librados-dev librbd-dev
2016-01-06 19:07:02 +00:00
RUN \
mkdir -p /goroot && \
curl https://storage.googleapis.com/golang/go1.5.2.linux-amd64.tar.gz | tar xvzf - -C /goroot --strip-components=1
ADD . $APPLOC
2016-01-06 19:07:02 +00:00
WORKDIR $APPLOC
RUN go get -d && \
go build -o /bin/ceph_exporter
2016-01-06 19:07:02 +00:00
FROM ubuntu:16.04
MAINTAINER Vaibhav Bhembre <vaibhav@digitalocean.com>
RUN apt-get update && \
apt-get install -y apt-transport-https curl && \
echo "deb https://download.ceph.com/debian-jewel xenial main" >> /etc/apt/sources.list && \
apt-get update && \
apt-get install -y --force-yes librados2 librbd1 && \
rm -rf /var/lib/apt/lists/*
COPY --from=builder /bin/ceph_exporter /bin/ceph_exporter
RUN chmod +x /bin/ceph_exporter
EXPOSE 9128
ENTRYPOINT ["/bin/ceph_exporter"]