重新编译ceph-exporter源码,构建镜像
1.github
https://github.com/digitalocean/ceph_exporter
2.dockerfile
FROM golang:1.17
ENV GO111MODULE=on \
GOPROXY="https://goproxy.cn,direct"
COPY ceph_exporter-4.2.1 /apps/ceph_exporter-4.2.1
WORKDIR /apps/ceph_exporter-4.2.1
ARG TEST
RUN apt-get update && \
apt-get install -y --force-yes librados-dev librbd-dev
RUN go get -d
RUN if [ -n "${TEST}" ]; then go test -tags nautilus -v -race -count=1 ./...; fi
RUN go build -tags nautilus -o /bin/ceph_exporter
RUN chmod +x /bin/ceph_exporter
EXPOSE 9128
ENTRYPOINT ["/bin/ceph_exporter"]