1.github
https://github.com/ofesseler/gluster_exporter
2.dockerfile
FROM golang:1.17 ENV GO111MODULE=on \ GOPROXY="https://goproxy.cn,direct" COPY gluster_exporter-0.2.7 /apps/gluster_exporter-0.2.7 WORKDIR /apps/gluster_exporter-0.2.7 RUN go mod init RUN go mod vendor RUN go build EXPOSE 9189 EXPOSE 24007 EXPOSE 24008 RUN mkdir -p /data RUN mkdir -p /mnt/data RUN mkdir -p /mnt/gv_test RUN cp /apps/gluster_exporter-0.2.7/gluster-init.sh /usr/bin/gluster-init.sh RUN chmod a+x /usr/bin/gluster-init.sh RUN cp /apps/gluster_exporter-0.2.7/gluster_exporter /usr/bin/gluster_exporter WORKDIR /apps/gluster_exporter-0.2.7 ENTRYPOINT sh /usr/bin/gluster-init.sh
标签:exporter,RUN,0.2,apps,gluster,init,源码 From: https://www.cnblogs.com/wdgde/p/17025877.html