2022-03-18 17:04:51 +00:00
|
|
|
FROM ubuntu:20.04 as builder
|
2016-01-06 19:07:02 +00:00
|
|
|
MAINTAINER Vaibhav Bhembre <vaibhav@digitalocean.com>
|
|
|
|
|
2020-06-03 16:08:10 +00:00
|
|
|
ARG TEST
|
|
|
|
|
2016-01-06 22:20:47 +00:00
|
|
|
ENV GOROOT /goroot
|
2016-01-06 19:07:02 +00:00
|
|
|
ENV GOPATH /go
|
2016-01-06 22:20:47 +00:00
|
|
|
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
|
|
|
|
2016-12-09 11:24:43 +00:00
|
|
|
RUN apt-get update && \
|
2018-05-10 03:04:07 +00:00
|
|
|
apt-get install -y apt-transport-https build-essential git curl wget
|
2016-06-23 17:48:54 +00:00
|
|
|
|
2018-05-10 03:04:07 +00:00
|
|
|
RUN wget -q -O- 'https://download.ceph.com/keys/release.asc' | apt-key add -
|
2022-03-18 17:04:51 +00:00
|
|
|
RUN echo "deb https://download.ceph.com/debian-nautilus focal main" >> /etc/apt/sources.list
|
2016-06-23 17:48:54 +00:00
|
|
|
|
2016-12-29 18:45:46 +00:00
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y --force-yes librados-dev librbd-dev
|
2016-01-06 19:07:02 +00:00
|
|
|
|
2016-01-06 22:20:47 +00:00
|
|
|
RUN \
|
|
|
|
mkdir -p /goroot && \
|
2022-03-18 17:04:51 +00:00
|
|
|
curl https://storage.googleapis.com/golang/go1.18.linux-amd64.tar.gz | tar xvzf - -C /goroot --strip-components=1
|
2016-01-06 22:20:47 +00:00
|
|
|
|
2016-05-18 01:04:32 +00:00
|
|
|
ADD . $APPLOC
|
2016-01-06 19:07:02 +00:00
|
|
|
WORKDIR $APPLOC
|
2020-06-03 16:08:10 +00:00
|
|
|
RUN go get -d
|
2022-03-18 17:04:51 +00:00
|
|
|
# The `-tags pacific` instructs go-ceph to enable additional support nautilus release.
|
2020-10-28 18:42:52 +00:00
|
|
|
# See https://github.com/ceph/go-ceph#installation
|
2022-03-18 17:04:51 +00:00
|
|
|
RUN if [ -n "${TEST}" ]; then go test -tags pacific -v -race -count=1 ./...; fi
|
|
|
|
RUN go build -tags pacific -o /bin/ceph_exporter
|
2017-06-13 04:58:18 +00:00
|
|
|
|
2022-03-18 17:04:51 +00:00
|
|
|
FROM ubuntu:20.04
|
2017-06-13 04:58:18 +00:00
|
|
|
MAINTAINER Vaibhav Bhembre <vaibhav@digitalocean.com>
|
|
|
|
|
|
|
|
RUN apt-get update && \
|
2019-10-01 17:12:02 +00:00
|
|
|
apt-get install -y apt-transport-https curl wget gnupg
|
2018-05-10 03:04:07 +00:00
|
|
|
RUN wget -q -O- 'https://download.ceph.com/keys/release.asc' | apt-key add -
|
2022-03-18 17:04:51 +00:00
|
|
|
RUN echo "deb https://download.ceph.com/debian-nautilus focal main" >> /etc/apt/sources.list && \
|
2017-06-13 04:58:18 +00:00
|
|
|
apt-get update && \
|
2018-08-01 13:37:07 +00:00
|
|
|
apt-get install -y --force-yes librados2 librbd1 ceph-common && \
|
2017-06-13 04:58:18 +00:00
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
COPY --from=builder /bin/ceph_exporter /bin/ceph_exporter
|
|
|
|
RUN chmod +x /bin/ceph_exporter
|
|
|
|
|
2016-01-29 14:42:20 +00:00
|
|
|
EXPOSE 9128
|
2016-01-07 18:44:31 +00:00
|
|
|
ENTRYPOINT ["/bin/ceph_exporter"]
|